exec.setMaxPoolSize(N);
433707
public void setCorePoolSize(int corePoolSize) {
        if (corePoolSize < 0)
            throw new IllegalArgumentException();
        int delta = corePoolSize - this.corePoolSize;
        this.corePoolSize = corePoolSize;
        if (workerCountOf(ctl.get()) > corePoolSize)
            interruptIdleWorkers();
        else if (delta > 0) {
            // We don't really know how many new threads are "needed".
            // As a heuristic, prestart enough new workers (up to new
            // core size) to handle the current number of tasks in
            // queue, but stop if queue becomes empty while doing so.
            int k = Math.min(delta, workQueue.size());
            while (k-- > 0 && addWorker(null, true)) {
                if (workQueue.isEmpty())
                    break;
            }
        }
    }
68054
public long setMaximumSize(long numBytes) {
        long pageSize = getPageSize();
        long numPages = numBytes / pageSize;
        // If numBytes isn't a multiple of pageSize, bump up a page
        if ((numBytes % pageSize) != 0) {
            numPages++;
        }
        long newPageCount = DatabaseUtils.longForQuery(this, "PRAGMA max_page_count = " + numPages,
                null);
        return newPageCount * pageSize;
    }
343569
private Integer getLargestValidPoolSize(Integer poolSize, Double forecast) {
        Integer largestPoolSize = -1;
        // find largest poolSize with valid data
        boolean validLargeData = false;
        while (!validLargeData) {
            largestPoolSize = threadStats.lastKey();
            ThroughputDistribution largestPoolSizeStats = getThroughputDistribution(largestPoolSize, false);;
            // prune any data that is too old or outside believable range
            if (pruneData(largestPoolSizeStats, forecast)) {
                threadStats.remove(largestPoolSize);
            } else {
                validLargeData = true;
            }
        }
        return largestPoolSize;
    }
103476
function maxOrMin( args, method ) {
            var m, n,
                i = 0;

            if ( isArray( args[0] ) ) args = args[0];
            m = new BigNumber( args[0] );

            for ( ; ++i < args.length; ) {
                n = new BigNumber( args[i] );

                // If any number is NaN, return NaN.
                if ( !n.s ) {
                    m = n;
                    break;
                } else if ( method.call( m, n ) ) {
                    m = n;
                }
            }

            return m;
        }
456672
@Override
    public final IntStream limit(long maxSize) {
        if (maxSize < 0)
            throw new IllegalArgumentException(Long.toString(maxSize));
        return SliceOps.makeInt(this, 0, maxSize);
    }
798980
def setMaximumSize(self, *args):
        
        super(XView, self).setMaximumSize(*args)
        
        if ( not self.signalsBlocked() ):
            self.sizeConstraintChanged.emit()
1304428
public Elasticsearch bulkFlushMaxSize(String maxSize) {
		internalProperties.putMemorySize(CONNECTOR_BULK_FLUSH_MAX_SIZE, MemorySize.parse(maxSize, MemorySize.MemoryUnit.BYTES));
		return this;
	}
1311057
private void setEntityManagerPoolSize(String poolSize) {

        setExtProperty(
            CmsDbPoolV11.KEY_DATABASE_POOL + '.' + getPool() + '.' + CmsDbPoolV11.KEY_ENTITY_MANAGER_POOL_SIZE,
            poolSize);
    }
273727
private synchronized void fillPool()
   {
      final int connectionsToAdd = Math.min(config.getMaximumPoolSize() - getTotalConnections(), config.getMinimumIdle() - getIdleConnections())
                                   - addConnectionQueue.size();
      for (int i = 0; i < connectionsToAdd; i++) {
         addConnectionExecutor.submit((i < connectionsToAdd - 1) ? poolEntryCreator : postFillPoolEntryCreator);
      }
   }
92124
private void updateSlotLimit(
      final Pool pool, final TaskType type, LimitType limitType) {
    if (poolMgr.fifoWeight(pool.getName())) {
      updateSlotLimitFifo(pool, type, limitType);
      return;
    }
    // Find the proper ratio of (# of minSlots / weight) by bineary search
    BinarySearcher searcher = new BinarySearcher() {
      @Override
      double targetFunction(double x) {
        return poolSlotsUsedWithWeightToSlotRatio(pool, x, type, false);
      }
    };
    int total = getPoolSlotLimit(pool, type, limitType);
    double lastRatio = getLastRatio(pool, limitType);
    double ratio = searcher.getSolution(total, lastRatio);
    setLastRatio(pool, limitType, ratio);

    int leftOver = total;
    List<JobInfo> candidates = new LinkedList<JobInfo>();
    for (JobInProgress job : pool.getJobs()) {
      JobInfo info = infos.get(job);
      if (info == null) {
        throw new IllegalStateException("Couldn't find job " + job.jobId +
            " in pool " + pool.getName());
      }
      candidates.add(info);
      if (leftOver == 0) {
        setSlotLimit(info, 0, type, limitType);
      }
      int slots = (int)Math.floor(computeShare(info, ratio, type, false));
      if (leftOver >= slots) {
        leftOver -= slots;
        setSlotLimit(info, slots, type, limitType);
      }
    }
    // Assign the left over slots in round-robin order
    for (int i = 0; i < leftOver && !candidates.isEmpty(); ++i) {
      JobInfo info = candidates.remove(0);
      if (incSlotLimit(info, type, limitType)) {
        candidates.add(info);
      }
    }
  }
883585
private void increaseCapacity() {
    int newCapacity = (valueslength.capacity() == 0) ? DEFAULT_INIT_SIZE
        : valueslength.capacity() < 64 ? valueslength.capacity() * 2
            : valueslength.capacity() < 1024 ? valueslength.capacity() * 3 / 2
                : valueslength.capacity() * 5 / 4;

    final ShortBuffer nv = ShortBuffer.allocate(newCapacity);
    valueslength.rewind();
    nv.put(valueslength);
    valueslength = nv;
  }
908080
def global_maxpooling(attrs, inputs, proto_obj):
    """"""
    new_attrs = translation_utils._add_extra_attributes(attrs, {'global_pool': True,
                                                                'kernel': (1, 1),
                                                                'pool_type': 'max'})
    return 'Pooling', new_attrs, inputs
1152564
public Integer getMaxPoolSize()
   {
      if (childNode.getTextValueForPatternName("max-pool-size") != null && !childNode.getTextValueForPatternName("max-pool-size").equals("null")) {
         return Integer.valueOf(childNode.getTextValueForPatternName("max-pool-size"));
      }
      return null;
   }
929556
function resizeBuffer (length) {
  if (bufferPool.length < length + bufferOffset) {
    const multiplier = length > 1024 * 1024 * 75 ? 2 : 3
    if (bufferOffset > 1024 * 1024 * 111) {
      bufferOffset = 1024 * 1024 * 50
    }
    bufferPool = Buffer.allocUnsafe(length * multiplier + bufferOffset)
    bufferOffset = 0
    counter++
    if (interval === null) {
      interval = setInterval(decreaseBufferPool, 50)
    }
  }
}
1143679
private JedisPoolConfig onPoolConfig(final byte WHEN_EXHAUSTED_FAIL, String maxActivePerNode,
            String maxIdlePerNode, String minIdlePerNode, String maxTotal)
    {
        if (!StringUtils.isBlank(maxActivePerNode) && StringUtils.isNumeric(maxActivePerNode))
        {
            logger.info("configuring connection pool");

            JedisPoolConfig poolConfig = new JedisPoolConfig();

            if (maxTotal != null && StringUtils.isNumeric(maxTotal))
            {
                poolConfig.setMaxTotal(Integer.valueOf(maxTotal));
            }
            if (maxIdlePerNode != null && StringUtils.isNumeric(maxIdlePerNode))
            {
                poolConfig.setMaxIdle(Integer.valueOf(maxIdlePerNode));
            }
            if (minIdlePerNode != null && StringUtils.isNumeric(minIdlePerNode))
            {
                poolConfig.setMinIdle(Integer.parseInt(minIdlePerNode));
            }
            if (maxActivePerNode != null && StringUtils.isNumeric(maxActivePerNode))
            {
                //poolConfig.setWhenExhaustedAction(WHEN_EXHAUSTED_FAIL);
                poolConfig.setBlockWhenExhausted(true);
            }
            return poolConfig;
        }

        return null;
    }
1007987
public synchronized int getPoolGroupMaximum(String poolGroupName,
                                              ResourceType type) {
    Integer max = (typePoolGroupNameToMax == null) ? null :
        typePoolGroupNameToMax.get(type, poolGroupName);
    return max == null ? Integer.MAX_VALUE : max;
  }
1241011
private void applyPoolConfiguration(PoolConfiguration pc,
                                       org.ironjacamar.common.api.metadata.common.Pool p)
   {
      if (p != null)
      {
         if (p.getMinPoolSize() != null)
            pc.setMinSize(p.getMinPoolSize().intValue());

         if (p.getInitialPoolSize() != null)
            pc.setInitialSize(p.getInitialPoolSize().intValue());

         if (p.getMaxPoolSize() != null)
            pc.setMaxSize(p.getMaxPoolSize().intValue());

         if (p.isPrefill() != null)
            pc.setPrefill(p.isPrefill().booleanValue());
         if (p.getFlushStrategy() != null)
            pc.setFlushStrategy(p.getFlushStrategy());

      }
   }