Hi Geert, One way to test this for CHM is to write a system test where CHM is populated with large data set that cannot be held in memory without the memory manager properly flushing the values to L2. If the memory manager is not working correctly then it will cause an OOME. One tricky thing is that the test needs to be tuned to run correctly in fast and slow monkeys.
This kind of strategy is used in ClientMemoryReaperTest and MapOfMapsTest. If you want to test the correctness of your implementation of the interface, I would suggest you write unit test cases for that. cheers, Saravanan Geert Bevin wrote: > Hi Saravanan, > > maybe you can help me. > > I've written a test for the implementation of the Clearable interface > for ConcurrentHashMap: > http://svn.terracotta.org/fisheye/browse/Terracotta/dso/branches/2.5/code/base/dso-tests-jdk15/tests.system/com/tctest/ConcurrentHashMapTestApp.java?r=6091#l767 > > > > I based my implementation of the Clearable interface on what is done > in HashMapTC, and thus perform a check on each entry value to see if > Cacheable.recentlyAccessed() returns true. If it does, the value isn't > cleared: > http://svn.terracotta.org/fisheye/browse/Terracotta/dso/branches/2.5/code/base/dso-l1-jdk15/src/java/util/concurrent/ConcurrentHashMapTC.java?r=6091#l110 > > > > However, to perform the test, I would like to enforce the > ClockEvictionPolicy to run or use some other method to make all the > CHM entries not recently accessed. Can you think of one? > > I'm about to write a similar method as __tc_clearReferences simply for > this test. Instead of clearing the values, it would clear the accessed > indicator. I however want to check with you first to see if there's > not an existing way to do this already. > > Thanks for the help, > > Geert > > -- > Geert Bevin > Terracotta - http://www.terracotta.org > Uwyn "Use what you need" - http://uwyn.com > RIFE Java application framework - http://rifers.org > Music and words - http://gbevin.com > _______________________________________________ tc-dev mailing list [email protected] http://lists.terracotta.org/mailman/listinfo/tc-dev
