views:

24

answers:

1

Hi, does anyone know how to set the max heap size when starting equinox? I start the container from the command line as follows:

java -jar org.eclipse.osgi_3.5.2.jar -console -Xmx1024M -Xms512M -XX:[MaxPermSize]=256M

However, this has no effect on the max heap size and I end up with an OutOfMemoryException. I am trying to deploy a war bundle using the catalina osgi bundle and spring-web-extender, so any tips on how to set java_opts for a tomcat osgi bundle would be appreciated also.

Thanks

Barry

+3  A: 

You have to pass the JVM heap args before calling the -jar

java -Xmx1024M -Xms512M -XX:MaxPermSize=256m -jar org.eclipse.osgi_3.5.2.jar -console

This useful link says

Note that when you run java with -jar option, anything after -jar jar-file will be treated as application arguments. So you should always put JVM options before -jar.

JoseK
Thats works fine now. Many thanks.
Barry