Increase Java Memory in Debian

Our Openfire server only has 64 mb of JM and I cannot figure out where in Debian one changes this amount. I know in Redhat it would be in etc/sysconfig according to a post I saw on this board but does anyone know how to go about changing this figure on Debian? Thank you in advance for any help.

Check /etc/default/openfire if you start the server with its init.d scripts. The entry you should have to change is “-Xmxx64m” (I think so)

Open ‘/opt/openfire/bin/openfire’ and change this:

INSTALL4J_ADD_VM_PARAMS="-Xms128m -Xmx128m"

this will set your memory to 128 Mb, replace 128 with everything you want…

Thanx. That worked like a charm. What would be a good Java Memory number for a Debian Openfire server with 1 GB of physical memory?

I think this is dependent from the number of user on your server. I am running a server with more than 850 registered users, at maximum are 150-160 users online at the same time. (statistics) The server does run with 64 Mb, but to be sure I set it to 128 Mb.

You should now that Java always does use this amount of memory you set, even if it does not need it. The Java garbage collector does not run until you run out of memory.


why do you want to set the memory to a high value?

You may use 32 MB for linux and 128 MB for the native heap of the JVM so you could set Xmx to nearly 900 MB if you want to and if you have no other applications running.

Take a look on Heap Settings in JVM Settings and Debugging and enable the GC log for some days or weeks, it will show you the memory usage. Or check the Java Memory on a regular basis on http://yourserver:9090/index.jsp .