Hi,
    I am using the mina core lib.
    I think that the class CachedBufferAllocator has 2 bugs:

1. DEFAULT_MAX_CACHED_BUFFER_SIZE
    private static final int DEFAULT_MAX_CACHED_BUFFER_SIZE = 1 << 18; // 256KB


2. newPoolMap method
    Map<Integer, Queue<CachedBuffer>> newPoolMap() {
        Map<Integer, Queue<CachedBuffer>> poolMap =
                new HashMap<Integer, Queue<CachedBuffer>>();
        int poolSize = maxPoolSize == 0 ? DEFAULT_MAX_POOL_SIZE : maxPoolSize;

        for (int i = 0; i < 31; i++) {
            poolMap.put(1 << i, new ConcurrentLinkedQueue<CachedBuffer>());
        }

        poolMap.put(0, new ConcurrentLinkedQueue<CachedBuffer>());
        poolMap.put(Integer.MAX_VALUE, new 
ConcurrentLinkedQueue<CachedBuffer>());

        return poolMap;
    }
Is it? Thank u


Tianyudu


Reply via email to