Page 1 of 1

Could not reserve enough space for object heap

PostPosted:Mon May 20, 2013 1:59 pm
by HarryW
Hi,

I downloaded the Windows bundle of OpenKM and installed it on a NB with Windows XP SP3, 3GB RAM, 1,7GB free.
This is what I get when I try to start it:
Code: Select all
F:\Programme\openkm-6.2.3-community\tomcat\bin>catalina run
Using CATALINA_BASE:   "F:\Programme\openkm-6.2.3-community\tomcat"
Using CATALINA_HOME:   "F:\Programme\openkm-6.2.3-community\tomcat"
Using CATALINA_TMPDIR: "F:\Programme\openkm-6.2.3-community\tomcat\temp"
Using JRE_HOME:        "c:\Programme\Java\jdk1.6.0_25\"
Using CLASSPATH:       "F:\Programme\openkm-6.2.3-community\tomcat\bin\bootstrap.jar;F:\Programme\openkm-6.2.3-community\tomcat\bin\tomcat-juli.jar"
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
According to some information I found in this and other forums I tried to add this to catalina.bat:
set "JAVA_OPTS=-Xms1024m -Xmx1024m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:PermSize=512m -XX:MaxPermSize=512m"
I also tried to change the values in setenv.bat according to a thread in this forum but the error is always the same.

Any suggestions what else might be the problem?

As a side note: I also installed Logicaldoc which comes with its own Tomcat7 server and that one works.

Re: Could not reserve enough space for object heap (Solved)

PostPosted:Mon May 20, 2013 4:10 pm
by HarryW
After some more tests I decided to uninstall and re-install the aplication.
I then changed in setenv.bat "set JAVA_OPTS=-Xms256m -Xmx2048m..." to "set JAVA_OPTS=-Xms256m -Xmx1024m..." and now it works...

Funny thing is, I did this before and it did not work... But anyway. Problem solved.

Re: Could not reserve enough space for object heap

PostPosted:Tue May 21, 2013 9:15 am
by jllort
for heap problems should modify -XX:PermSize=256m -XX:MaxPermSize=512m

Take in mind you should control your server has enought memory for Os, other apps, and which will be used by tomcat

Re: Could not reserve enough space for object heap

PostPosted:Sat Nov 05, 2016 8:48 pm
by jaunty
I would like to have more information too, because I have similar situation as earlier commentator. I greet you

Re: Could not reserve enough space for object heap

PostPosted:Mon Nov 07, 2016 8:13 am
by jllort
At setenv.xh or setenv.bat must reserve memory for the heap ( as I explained in the previous post ). If you are using jdk 1.7 or below increase MaxPermSize ( for upper version the heap is automatically redimesioned by the VM )
Code: Select all
-XX:PermSize=256m -XX:MaxPermSize=512m

Re: Could not reserve enough space for object heap

PostPosted:Mon Feb 20, 2017 7:06 pm
by douglas.cunha
I had the same problem after uploading some big files. Now I get OutOfMemoryException error whenever the service try to start.

Already switched to 64-bit Java and increased the default options.

I changed my setenv.bat to:
Code: Select all
set JAVA_OPTS =-Xms512m-Xmx2048m - XX: PermSize = 128M - XX: MaxPermSize = 512m-Djava.awt.headless=true-Dfile.encoding=utf-8
What else can I do to get it to start again?

Re: Could not reserve enough space for object heap

PostPosted:Tue Feb 21, 2017 7:39 pm
by jllort
Be care with spaces, seems you have missed some one and others should be removed like between 512m-Djava

This is yours:
Code: Select all
set JAVA_OPTS =-Xms512m-Xmx2048m - XX: PermSize = 128M - XX: MaxPermSize = 512m-Djava.awt.headless=true-Dfile.encoding=utf-8
I suggest
Code: Select all
set JAVA_OPTS =-Xms512m -Xmx2048m -XX:PermSize=128M -XX:MaxPermSize=512m -Djava.awt.headless=true -Dfile.encoding=utf-8
or ( with increased heap size to 1024m )
Code: Select all
set JAVA_OPTS =-Xms512m -Xmx2048m -XX:PermSize=128M -XX:MaxPermSize=1024m -Djava.awt.headless=true -Dfile.encoding=utf-8

Re: Could not reserve enough space for object heap

PostPosted:Thu Jul 13, 2017 10:47 am
by dellmerca
Starting a JVM like below will start it with 256MB of memory, and will allow the process to use up to 2048MB of memory:
Code: Select all
java -Xmx2048m -Xms256m
More about...memory management

Dell