Java memory leak

Hi There,

anyone how to solve java memory leak.?

every feedback is highly appreciated.

A few options:

  1. Run Openfire with the VM parameter -XX:+HeapDumpOnOutOfMemoryError and wait until it crashes with an OutOfMemory error.

Then you should have a *.hprof file (heap dump) somewhere in the exection directory, which you can analyse with a tool.

  1. Attach a heap analyser to the Java process and analyse the heap live. I am using VisualVM for that.

  2. Maybe it’s not a memory leak but just too low memory. 247.5 MB isn’t much for a server.

1 Like

can you give me steps on how to increase java memory.?

my server is 8GB Ram, and i already did all suggested on the web but still unable to increase the java memory.

First of all why are you calling it a memory leak? Do you experience problems with the server? What you show in the screenshot is not a leak proof. This gauge bar will jump all the time as the garbage collector kicks in. This is how Java normally works. Try refreshing this page every second and you will see it drops at some point and start filling up again. If you give it more RAM it will use it, it won’t stay at 250.

How to add more memory (but you won’t be able to give all 8 GB, unless you are using x64 Java, but i can’t suggest how to use it): Openfire: Installation Guide

Custom Parameters

Advanced users may wish to pass in parameters to the Java virtual machine (VM) to customize the runtime environment of Openfire. You can do this by creating openfire.vmoptions files in the bin/ directory of your Openfire installation. For the Windows service, you’d create a new text file called openfire-service.vmoptions. Each parameter to the VM should be on a new line of the file. For example, to set the minimum heap size to 512 MB and max VM heap size to 1024 MB, you’d use:



To create parameters for the normal launcher, create a file called openfired.vmoptions (since the openfire.exe launcher invokes the openfired.exe executable to actually start the server).

1 Like

sorry, i thought it was memory leak, co’z once java memory gauge reach its maximum memory limit my spark client unable to login, then i will do is to restart the server.

i’m using x64 java but openfire didn’t recognize it, and i already created the openfire-service.vmoptions and set that parameters but then, it did not increase java memory in the server.

can you please give me exact steps.?

thank you very much!

Shows us the content of your vmoptions files. 32-bit java has a limit (i don’t remember, something around 1200 MB). so if you put too large number, maybe it doesn’t work this way.

1 Like

hi there,

finally i was able to increase java memory.

thank you very much for the support!



How you resolve, could you elaborate please ?

For me, it obeyed the following guideline:
section → ### Custom Parameters

But, when I installed Java x64 and the latest version of openfire (currently 4.7.4), the amount of memory got even bigger than what I defined.