fresco icon indicating copy to clipboard operation
fresco copied to clipboard

New bucket have always max length equal Integer.MAX_VALUE.

Open june-qijun opened this issue 11 years ago • 1 comments

Base_Pool: 623
Bucket newBucket(int bucketedSize) { return new Bucket( /itemSize/ getSizeInBytes(bucketedSize), /maxLength/ Integer.MAX_VALUE, /inUseLength/ 0); }

When call the base_pool.get(), if the bucket with preferred size not found, a new bucket with max length equal max length will be created with the same size of the given one. Would it lead to some big memory always in the free list? For example, usually we have small memory get from the pool, but suddenly we get a big memory than close it. It seem that the big memory will live in the free list for long time, waste of memory.

june-qijun avatar Jul 16 '15 00:07 june-qijun

In scenario where new buckets may be created (mAllowNewBuckets == true) we rely on pool's soft cap to limit memory consumed by entires in all buckets.

michalgr avatar Jul 17 '15 05:07 michalgr