mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-156259 idea.log spammed by "PerformanceWatcher - High memory usage"
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user