IDEA-156259 idea.log spammed by "PerformanceWatcher - High memory usage"

This commit is contained in:
peter
2016-05-19 10:44:18 +02:00
parent f1c0605e71
commit 1d157152c1
@@ -292,12 +292,13 @@ public class PerformanceWatcher implements ApplicationComponent {
}
private static void checkMemoryUsage(File file) {
final Runtime rt = Runtime.getRuntime();
final long allocatedMem = rt.maxMemory();
final long unusedMem = rt.freeMemory();
if (unusedMem < allocatedMem / 5) {
LOG.info("High memory usage (free " + unusedMem / 1024 / 1024 +
" of " + allocatedMem / 1024 / 1024 +
Runtime rt = Runtime.getRuntime();
long maxMemory = rt.maxMemory();
long usedMemory = rt.totalMemory() - rt.freeMemory();
long freeMemory = maxMemory - usedMemory;
if (freeMemory < maxMemory / 5) {
LOG.info("High memory usage (free " + freeMemory / 1024 / 1024 +
" of " + maxMemory / 1024 / 1024 +
" MB) while dumping threads to " + file);
}
}