We have a requirement to cache the large java objects . The objects size varies from few Kbs to Mbs now in worst case if we load all elements this will incur OOM so we want a strategy to limit the no of elements in the cache based on the total size of elements . For example lets say i want my cache to hold max 5 Gb of data at any given time