You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Ehcache 3.6,1, for heap-based caches sized with EntryUnit.ENTRIES, calling TierStatistics.getOccupiedByteSize() returns -1 rather than the actually memory size.
This is because memory size is not tracked for ENTRIES limited caches.
In Ehcache 2.x, it was supported using cache.calculateInMemorySize().
To avoid this, please provide support to calculate the memory size on demand when TierStatistics.getOccupiedByteSize() is invoked for an ENTRIES limited cache.
The text was updated successfully, but these errors were encountered:
The ever increasing complexity of sizing operations in later JDK versions make this unlikely to ever be implemented. Most users (who aren't jumping through hoops to make byte based sizing work) will never be able to have a functional version of this method. Closing for now since this may never get implemented. Feel free to lobby the JDK guys on https://bugs.openjdk.org/browse/JDK-8249196. If that issue ever makes progress then this feature may be more practical.
(Originally from this thread: https://groups.google.com/d/msg/ehcache-users/V82PvoA7wUI/J4x8HOjIBAAJ )
In Ehcache 3.6,1, for heap-based caches sized with EntryUnit.ENTRIES, calling TierStatistics.getOccupiedByteSize() returns -1 rather than the actually memory size.
This is because memory size is not tracked for ENTRIES limited caches.
In Ehcache 2.x, it was supported using cache.calculateInMemorySize().
The workaround is to use SizeOf.deepSizeOf() on the cache instance, but this requires internal knowledge of the cache (see https://groups.google.com/d/msg/ehcache-users/V82PvoA7wUI/vELd7FRKBQAJ )
To avoid this, please provide support to calculate the memory size on demand when TierStatistics.getOccupiedByteSize() is invoked for an ENTRIES limited cache.
The text was updated successfully, but these errors were encountered: