I'm assuming this is not currently possible.
I would like to combine a maxEntries-based eviction with a memory-based eviction.
In my usage scenario which is a local non-distributed cache, most cache entries are very small, but they can also be a thousand times as large in specific usage scenarios of which we are unsure how likely they are.
I would like to evict entries if either of the limits has been reached, e.g. one million entries or more than one gigabyte of memory.
Unfortunately this is not currently possible. The two configurations are mutually exclusive. I would suggest logging an improvement to JIRA if you want. There are other enhancements to data container that will most likely be happening within the next few releases that will make this feature easier to implement.