MrChang0 commented on PR #1639:
URL: https://github.com/apache/incubator-fury/pull/1639#issuecomment-2119204369

   I explain it.
   ```java
     @Test
       public void testCache() throws InterruptedException {
         Cache<String, String> cache = 
CacheBuilder.newBuilder().expireAfterAccess(Duration.ofSeconds(1)).build();
         cache.put("1", "1");
         cache.put("2", "2");
         Assert.assertEquals(cache.size(), 2);
         Thread.sleep(800);
         cache.getIfPresent("1");
         // clean up do nothing, because key1, key2 both alive.
         cache.cleanUp();
         Assert.assertEquals(cache.size(), 2);
         Thread.sleep(800);
         cache.getIfPresent("1");
         Assert.assertEquals(cache.size(), 2);
         Thread.sleep(800);
         cache.getIfPresent("1");
        // key2 is expired, but if not cleanup, key2 will not clean. may be 
case memory leak
         Assert.assertEquals(cache.size(), 2);
         cache.cleanUp();
        // clean up clear key2, because key2 is expired.
         Assert.assertEquals(cache.size(), 1);
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to