diff --git a/src/main/java/com/taobao/gecko/core/buffer/CachedBufferAllocator.java b/src/main/java/com/taobao/gecko/core/buffer/CachedBufferAllocator.java
index 01ac3f6..3181963 100644
--- a/src/main/java/com/taobao/gecko/core/buffer/CachedBufferAllocator.java
+++ b/src/main/java/com/taobao/gecko/core/buffer/CachedBufferAllocator.java
@@ -34,24 +34,24 @@
*/
package com.taobao.gecko.core.buffer;
+import com.taobao.gecko.core.util.CircularQueue;
+
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
-import com.taobao.gecko.core.util.CircularQueue;
-
/**
* An {@link IoBufferAllocator} that caches the buffers which are likely to be
* reused during auto-expansion of the buffers.
- *
+ *
* In {@link SimpleBufferAllocator}, the underlying {@link ByteBuffer} of the
* {@link IoBuffer} is reallocated on its capacity change, which means the newly
* allocated bigger {@link ByteBuffer} replaces the old small {@link ByteBuffer}
* . Consequently, the old {@link ByteBuffer} is marked for garbage collection.
- *
+ *
* It's not a problem in most cases as long as the capacity change doesn't
* happen frequently. However, once it happens too often, it burdens the VM and
* the cost of filling the newly allocated {@link ByteBuffer} with {@code NUL}
@@ -66,11 +66,11 @@
*
* Please note the observation above is subject to change in a different
* environment.
- *
+ *
* {@link CachedBufferAllocator} uses {@link ThreadLocal} to store the cached
* buffer, allocates buffers whose capacity is power of 2 only and provides
* performance advantage if {@link IoBuffer#free()} is called properly.
- *
+ *
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (Thu, 26 Jun 2008)
* $
@@ -80,7 +80,7 @@ public class CachedBufferAllocator implements IoBufferAllocator {
private static final int DEFAULT_MAX_POOL_SIZE = 8;
private static final int DEFAULT_MAX_CACHED_BUFFER_SIZE = 1 << 18; // 256KB
- private final int maxPoolSize;
+ private final int maxPoolSize;//等于0表示不限制CircularQueue的长度
private final int maxCachedBufferSize;
private final ThreadLocal