Created
June 22, 2016 09:46
-
-
Save knight-ryu12/319c3dc1abf911565e9bf664130a92c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thread GCThread = new Thread(() -> { | |
long CurrentMem = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory() / (1024 * 1024)); | |
System.gc(); | |
CurrentMem = CurrentMem - (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory() / (1024 * 1024)); | |
logger.info("GC executed. Freed Memory " + CurrentMem+"MB"); | |
try{ | |
Thread.sleep(Long.parseLong(configuration.getProperty("GCTime"))); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
//logger.info("GC executed. Freed Memory " + CurrentMem); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment