IDEA-CR-23149

This commit is contained in:
Vladimir.Orlov
2017-07-21 10:02:07 +03:00
parent 84e2e5e72c
commit a54d5fef54
2 changed files with 8 additions and 17 deletions
@@ -16,6 +16,7 @@
package com.intellij.ide;
import com.intellij.concurrency.JobScheduler;
import com.intellij.diagnostic.VMOptions;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.util.ExecUtil;
import com.intellij.ide.util.PropertiesComponent;
@@ -51,14 +52,11 @@ import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import java.awt.*;
import java.io.File;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.List;
public class SystemHealthMonitor implements ApplicationComponent {
@@ -78,28 +76,21 @@ public class SystemHealthMonitor implements ApplicationComponent {
@Override
public void initComponent() {
checkRuntime();
checkVMoptions();
checkReservedCodeCacheSize();
checkIBus();
checkSignalBlocking();
checkLauncherScript();
startDiskSpaceMonitoring();
}
private void checkVMoptions() {
RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
List<String> jvmArgs = runtimeMXBean.getInputArguments();
private void checkReservedCodeCacheSize() {
int minReservedCodeCacheSize = 240;
for (String arg : jvmArgs) {
if (arg.contains("-XX:ReservedCodeCacheSize=")) {
String vmOption = arg.substring(arg.lastIndexOf("=") + 1);
if (Integer.parseInt(vmOption.substring(0, vmOption.length() - 1)) < minReservedCodeCacheSize) {
showNotification(new KeyHyperlinkAdapter("vmoptions.warn.message"), vmOption, minReservedCodeCacheSize);
}
}
int reservedCodeCacheSize = VMOptions.readOption(VMOptions.MemoryKind.CODE_CACHE, true);
if (reservedCodeCacheSize < minReservedCodeCacheSize) {
showNotification(new KeyHyperlinkAdapter("vmoptions.warn.message"), reservedCodeCacheSize, minReservedCodeCacheSize);
}
}
private void checkRuntime() {
if (StringUtil.endsWithIgnoreCase(System.getProperty("java.version", ""), "-ea")) {
showNotification(new KeyHyperlinkAdapter("unsupported.jvm.ea.message"));
@@ -1158,8 +1158,8 @@ FileChooser.refreshActionLabelText=Refresh
browsers.settings=Web Browsers
updates.check.period.on.exit=On every exit
vmoptions.warn.message=ReservedCodeCacheSize is too low: {0}. \
Please increase it up to {1} to avoid performance degradation. \
vmoptions.warn.message=ReservedCodeCacheSize is too low: {0}m. \
Please increase it up to {1}m to avoid performance degradation. \
You could do it by "Help|Edit Custom VM Options..".
unsupported.jvm.ea.message=Early Access Java versions may cause compatibility issues. Please use stable release.