Example #1
0
 /**
  * Multi-thread read, put and removeAll test. This checks for memory leaks using the removeAll
  * which was the known cause of memory leaks with MemoryStore in JCS
  */
 @Test
 public void testMemoryLeak() throws Exception {
   try {
     // Sometimes this can be higher but a three hour run confirms no memory leak. Consider
     // increasing.
     assertThat(thrashCache(), OrderingComparison.lessThan(500000L));
   } catch (AssertionError e) {
     for (Entry<Thread, StackTraceElement[]> entry : Thread.getAllStackTraces().entrySet()) {
       new ThreadDumpException(entry.getKey(), entry.getValue()).printStackTrace(System.out);
     }
     throw e;
   }
 }