Java Memory Settings on Mac OS X 10.5.X

I’m trying to increase the java memory settings on Openfire 3.6.3 that’s running on Mac OS X 10.5.6 (not server) and I’m not finding where to do this. I see in the docs you are to add a file openfire-service.vmoptions with

-Xms1024m

-Xmx1536m

and can see where it show how with RedHat.

Do I add a line in the /usr/local/openfire/bin/openfire.sh file for this or can someone point me in the right direction? I have searched the forum and haven’t found my answer. Thanks in advance for your help.

Mike

Hi Mike,

also the openfire.sh script could support openfire.vmoptions. If “grep vmoptions /usr/local/openfire/bin/openfire.sh” returns “vmoptions_file=”$prg_dir/$progname.vmoptions"" then you may want to create it.

LG

Hey Mike,

Here is exactly what I do to bump it up. This is a direct copy and paste from another thread on this topic which is mentioned below. I see no reason why this wouldn’t work on OSX client.


Here’s what you need to do:

System Preferences > OpenFire > Stop Server (It’s important the server stops this way, cleanly)

Open terminal, sudo -s into root

nano /Library/LaunchDaemons/org.jivesoftware.openfire.plist

Ok, now look for

OPENFIRE_HOME
/usr/local/openfire

  under that add this:

    <key>OPENFIRE_OPTS</key>
   <string>-Xms256m -Xmx1024m</string>

You can set those settings to whatever you’d like, now save the file (ctrl+x > y)

This is where things get tricky, on Windows/Unix, you’re done, you just restart the server and it’s good to go.

I’m not sure if this was a mistake, or intentional, however it doesn’t look like OpenFire actually uses /usr/local/openfire/bin/openfire.sh to start, instead it uses this file: nano /usr/local/openfire/bin/extra/openfire-launchd-wrapper.sh

That’s where the problem truly is, you need to edit that file:

nano /usr/local/openfire/bin/extra/openfire-launchd-wrapper.sh

Look for:
/usr/bin/java -server -jar “$OPENFIRE_HOME/lib/startup.jar” -Dopenfire.lib.dir=/usr/local/openfire/lib&
And replace it with:
/usr/bin/java -server -jar $OPENFIRE_OPTS “$OPENFIRE_HOME/lib/startup.jar” -Dopenfire.lib.dir=/usr/local/openfire/lib&
I think this might be a bug in OpenFire that the folks at Ignite should take a look at.
Either way, save that (ctrl + x > y), go back to System Preferences > OpenFire, and start the server.
You should now be good to go!

Referenced from this link…
http://www.igniterealtime.org/community/message/177984#177984

The “vmoptions” isn’t in the file. I had allready tried adding a /usr/local/openfire/bin/openfire-service.vmoptions file just in case that was it.

It doesn’t appear that the Mac OS is using “/usr/local/openfire/bin/openfire.sh” file. I have changed things enough in the file that is should cause errors and it doesn’t. The hard thing to know for sure is on the Mac OS it has a start/stop openfire in the System Preference pane and sometimes it doesn’t work correctly and I will have to reboot the machine to get it running again (this is without doing anything to the openfire.sh file). Thanks for your help.

Mike

Great! Thanks Daniel, I will get back and give this a try. This looks like the information I was searching for.

This did work for me.

Thanks,

Mike

Awesome, glad it worked.

Regards,
Daniel