Great.  Now we can move forward. :-)

It means you are using `allocations` to determine the number of cache entries to free.  But I think it is not correct to do that.

For example, let's say we have 1024 entries in the cache, and did the following during the last 10 seconds:

```java
for (int i = 0; i < 512; i ++) {
    ByteBuf buf = ctx.alloc().buffer();
    buf.release();
}
```

`allocations` becomes 512 and `freeUpIfNecessary()` will free 512 cache entries.  However, it really should release 1023 entries.

Therefore, we should use the maximum number of the borrowed entries for the last 10 seconds instead.  e.g:

```java
private int maxEntriesInUse;
private int entriesInUse;

boolean allocate(...) {
    ...
    entriesInUse ++;
    if (maxEntriesInUse < entriesInUse) {
        maxEntriesInUse = entriesInUse;
    }
}

boolean add(...) {
    entriesInUse --;
}

void freeIfNecessary() {
    // Free N entries where N = size() - maxEntriesInUse.
    ...
    entriesInUse = 0;
    maxEntriesInUse = 0;
}
```

Additionally, we need to handle the buffers correctly that were allocated in one thread and then were released in the other thread, and it might add more complexity.