hazelcast/hazelcast — pull request #134 by dvinas (2012-04-24 09:22:09+00:00)
Title: Issue #110: Fixed MaxSizeHeapPolicy and MaxSizeHeapPercentagePolicy.

I made the following changes to CMap.java:

-Added a new method cost(), which determines the current cost of the map. (Tried to maintain a counter instead of iterating through the map, but records change size unpredictably, or have their values nulled before reindexing.)
-Fixed the implementations of both MaxSizeHeapPolicy and MaxSizeHeapPercentagePolicy using cost().
-Refactored startCleanup() so as not to call MapMaxSizePolicy.overCapacity() a 2nd time if it is called from CMap.overCapacity()->ConcurrentMapManager.executeCleanup() (indicated by forced=true). Removed redundant boolean logic.
-Added cost calculation to log message in startCleanup().