Skip to content
Snippets Groups Projects
Commit 5ad95a9e authored by Greg DiCristofaro's avatar Greg DiCristofaro
Browse files

add in catch

parent 6478dde7
No related branches found
No related tags found
No related merge requests found
...@@ -407,19 +407,27 @@ public void restored() { ...@@ -407,19 +407,27 @@ public void restored() {
"Installer_checkMemoryAvailable_maxMemExpected_desc=Maximum JVM memory: {0}, is less than the 2GB required. Some aspects of the application may not work as expected." "Installer_checkMemoryAvailable_maxMemExpected_desc=Maximum JVM memory: {0}, is less than the 2GB required. Some aspects of the application may not work as expected."
}) })
private void checkMemoryAvailable() { private void checkMemoryAvailable() {
long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory try {
.getOperatingSystemMXBean()).getTotalMemorySize(); long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory
if (memorySize < 8_000_000) { .getOperatingSystemMXBean()).getTotalMemorySize();
String desc = Bundle.Installer_checkMemoryAvailable_physicalRamExpected_desc( if (memorySize < 8_000_000) {
FileUtils.byteCountToDisplaySize(memorySize)); String desc = Bundle.Installer_checkMemoryAvailable_physicalRamExpected_desc(
logger.log(Level.SEVERE, desc); FileUtils.byteCountToDisplaySize(memorySize));
logger.log(Level.SEVERE, desc);
}
} catch (Throwable t) {
logger.log(Level.SEVERE, "There was an error fetching physical memory size", t);
} }
long maxMemory = Runtime.getRuntime().maxMemory(); try {
if (maxMemory < 2_000_000) { long maxMemory = Runtime.getRuntime().maxMemory();
String desc = Bundle.Installer_checkMemoryAvailable_maxMemExpected_desc( if (maxMemory < 2_000_000) {
FileUtils.byteCountToDisplaySize(maxMemory)); String desc = Bundle.Installer_checkMemoryAvailable_maxMemExpected_desc(
logger.log(Level.SEVERE, desc); FileUtils.byteCountToDisplaySize(maxMemory));
logger.log(Level.SEVERE, desc);
}
} catch (Throwable t) {
logger.log(Level.SEVERE, "There was an error fetching jvm max memory", t);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment