Increasing Java Memory

I have installed Openfire server I want to increase the Java memory size how I can do this

please help

Have a look at this tutorial: http://www.igniterealtime.org/community/docs/DOC-1033

You’re probably interested in the section that is called ‘heap settings’.

In the openfire/bin directory, add a vmoptions file. The first part of the name of the vmoptions file should be the same as the executable running the Openfire service. For example, on Windows running as a service, you’d create a file named openfire-service.vmoptions. Among other things in this file, you can define the minimum and maximum memory to allocate to the process in the Java VM.

For example:

-Xms512m
-Xmx1024m

It’s worth noting that you’re bound to the 32 bit 2 GB limit on memory size for the Java VM. While the process may need a certain amount of memory, Java also needs a certain amount. It’s all taken out of the same 2 GB space for the Java VM. Giving the process all the available memory space (2 GB) leaves nothing for Java. Allocating up to 1 GB for the process (see the above example) seems to be a good mark.

but this file is not there in opt/openfire/bin where it could be or may I need to creat it?Is there is any std format avalable for this fise ?what is the extention of this file?

please help

The vmoptions file is used to override the defaults used by Openfire and is not included with the installation. On Linux, create a plain text file /opt/openfire/bin/openfire.vmoptions and enter your memory options. My previous post has an example format.

Alternatively, you can add the options to the INSTALL4J_ADD_VM_PARAMS= line in ./bin/openfire

I use the following and it works well:

INSTALL4J_ADD_VM_PARAMS="-Djava.net.preferIPv4Stack=true -Xms32m -Xmx128m -Xss128k -Xoss128k -XX:ThreadStackSize=128"

HI

I have created a file openfire.vmoptions in /opt/openfire/bin path

I added

-Xms512m

-Xmx1024m

But there is no change in Java memory which is getting displayed in server information

any other change i nned to do in this

Hi,

if the openfire.vmoptions file does not work you may really want to do what Ryan did post and modify the Openfire start script and add as line 6 something like this: INSTALL4J_ADD_VM_PARAMS="-Djava.net.preferIPv4Stack=true -Xms32m -Xmx128m -Xss128k -Xoss128k -XX:ThreadStackSize=128"

LG

Where would you add that line 6 in a windows 2003 install ?

Hi Richard,

where on Windows do you have an /opt/openfire/bin path?

openfire-service.vmoptions or openfired.vmoptions should help one on Windows to set JVM parameters.

LG

I can’t seem to find /opt/openfire anywhere in this openfire folder, don’t know if I’ve missed something but

I think I have been through every sub folder and cannot find it

I have tried all the above things nothing works for me and facing lot of problem any bady here no the perfect solution on this

I am using centos and openfire 3.3.3

amol

in /etc/sysconfig/openfire

add:

OPENFIRE_OPTS="-Xms256m -Xmx512m"

or whatever settings you want.

tried all that things mentioned here in this discussion no use

Hi Amol,

do you mind posting the first 10 lines of the openfire start script which you did modify to set the Xmx value?

LG

if you used the /etc/sysconfig/openfire option you would need to restart openfire for the settings to be noticed. In fact for any of the solutions here you would need to restart openfire.

service openfire restart

(on Fedora + Redhat based systems)

Hi All

Following are the starting lines of my server please correct me If I am doing any misstake

  1. $RCSfile$
  2. $Revision: 1194 $
  3. $Date: 2005-03-30 13:39:54 -0300 (Wed, 30 Mar 2005) $
  4. tries to determine arguments to launch openfire
  5. OS specific support. $var must be set to either true or false.

#!/bin/sh # # INSTALL4J_ADD_VM_PARAMS="-Djava.net.preferIPv4Stack=true -Xms512m -Xmx1200m -Xss128k -Xoss128k -XX:ThreadStackSize=128" cygwin=false;
darwin=false;
linux=false;
case “uname” in
CYGWIN*) cygwin=true ;;
Darwin*) darwin=true
if ; then
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
fi
;;
Linux*) linux=true
jdks=ls -r1d /usr/java/j*
for jdk in $jdks; do
if ; then
JAVA_HOME="$jdk"
break
fi
done
;;
esac

Hi Amol,

are you using the rpm install? I never saw an Openfire script which starts like this so I wonder if this one accepts this parameter.

You may want to look for the line which starts with “nohup … java … startup.jar” and place your Xmx value after java. It should then look similar to

cd ${OPENFIRE_HOME}/logs
nohup ${JAVA_HOME}/bin/java -Xms64m -Xmx128m -jar ../lib/startup.jar >../logs/SDTOUT.log 2>../logs/SDTERR.log &

LG

yes I am using rpm installer

this script is located in \opt\oenfire\bin\openfire.sh

can you please guide me how & what should I install or may i need to replace this script with any other \

please guide Looking forword for your help ASAP

amol

Hi All

This problem is resolved by adding OPENFIRE_OPTS="-Xmx1512m"

in /etc/sysconfig/openfire file I restarted the services after that

Thanks a lot all of you for your support Now arround 1200 users are accessing this server from 3 different location in India

and IT is working nice

Thank you all

1 Like