Glassfish failed to start after heap size increase

I want to increase the heap size of my Glassfish. For this, I know that I can go up to 4 GB:

java -Xmx4000M -version java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode) 

I tried to set -Xmx to 2GB in the domain.xml file:

 <jvm-options>-Xmx2000m</jvm-options> 

But I get the following error:

 asadmin> start-domain Waiting for ... to start .Error starting domain ... The server exited prematurely with exit code 1. Before it died, it produced the following output: Error occurred during initialization of VM The size of the object heap + VM data exceeds the maximum representable size launchctl bsexec failed: Inappropriate ioctl for device 

Running the command with the -v option gives the following:

 12 oct. 2011 11:46:34 com.sun.enterprise.admin.launcher.GFLauncherLogger info INFO: JVM invocation command line: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -XX:+UnlockDiagnosticVMOptions -XX:MaxPermSize=512m -XX:NewRatio=2 -XX:+CMSClassUnloadingEnabled -Xmx2000m -Xms1000m ... 12 oct. 2011 11:46:35 com.sun.enterprise.admin.launcher.GFLauncherLogger info INFO: Successfully launched in 45 msec. Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. Command start-domain failed. 
+6
source share
3 answers

I found a problem. For some reason, which I don’t understand, the argument β€œ-d32” was sent to the command with a request to start in 32-bit mode. When adding

 <jvm-options>-d64</jvm-options> 

into the domain.xml file, the old fish begins. Note that this option is not in the file by default.

+12
source

You must use a different Java installation when doing the "-version" and from GlassFish. I can reproduce the same error with the standard "java" in the Mac OS path, but not when using the absolute path:

 % /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx2300m -version java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode) % java -Xmx2300m -version Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. 
0
source

Maybe you do not have enough disk space on your system? Backing up 4 GB of RAM may require the MAC OS to expand the swap space, and you may not have enough disk space for this. Unfortunately, this burned me before: - /

0
source

Source: https://habr.com/ru/post/899109/


All Articles