powered by Jive Software

OutOfMemoryError In Jive Messenger in Version 2.3

Hi:

I am using jive messenger . I have more than 100 clients installed on it. But some times I receive error . After restarting the server everything start working fine. I have java memory of 63.31MB. When i receive this error i see java memory over filled in admin console of jive messenger.

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “pool-2-thread-3” java.lang.OutOfMemoryError: Java heap space

Exception in thread “pool-2-thread-2” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “pool-2-thread-5” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “SocketListener0-1” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Exception in thread “Client SR” java.lang.OutOfMemoryError: Java heap space

Two recommendations:

  1. Increase the heap size about ~64 MB. That will give you more breathing room.

  2. If you can’'t increase the memory, decrease the stack size. You can do that by editing the vmoptions file to pass in -Xss16k (see the install doc for vmoptions file info).

Regards,

Matt

That is quite possible to get this Exception when you use Jive Messenger not only in Version 2.3, but all the versions. Jive Messenger assign one exclusive connection and thread to each client which is connecting to this server, so it is really resource-consuming. I suggest some points for you to avoid this:

  1. add argument to increase java VM maximum heap size, for example: add ‘’-Xmx1024m’’ behind ‘‘java’’ command

  2. add argument to minish java thread stack size, for example: add ‘’-Xss96k’’ behind ‘‘java’’ command

  3. the more complicated method, modify the code. You can let the server not assign one exclusive connection and thread to each client.

Hope this could help you.

Hi,

you could use VisualGC http://java.sun.com/performance/jvmstat/visualgc.html / http://java.sun.com/performance/jvmstat/ to take a look at the memory usage of your JVM. It is simple to use and you see which parts of the internal JVM memory are used and how much time you spend with garbage collections. I used it to tune the start-up time of Spark.

You may also want to look at http://java.sun.com/docs/hotspot/PerformanceFAQ.html or http://java.sun.com/docs/hotspot/PerformanceFAQ.html

Add ‘’-verbose:gc -XX:*PrintGCDetails -XX:*PrintGCTimeStamps -Xloggc:logs/gc.log’’ behind ‘‘nohup “$app_java_home/bin/java”’’ or set it in the wildfire.vmoptions file to get more memory informations. This will lead to some overhead, so maybe you will use it only for some tests.

I assume that -Xmx96m should be fine if the server crashes only some times with currently -Xmx64m. Do not try -Xmx1024m unless you know that you have 1 GB and also need 1 GB for jive messenger - it may slow down the JVM.

Maybe you will also modify the -Xms and -XX:NewSize= values for less garbage collections and a better performance.

LG

I tried to change the heap size by using java -Xms64m -Xmx512m but nothing happened . Still I can see the size is same. Plz guide me in steps how to change the heap size. Do I have to uninstall the jive messenger and install it again.

You need to add those parameters in the command that you use to start Wildfire. For example: if you use this command to startup wildfire

java -server -classpath something -jar \bla\blah.jar[/code]

modify that to include those extra attributes:

java -server -XssSOMEVALUE -XmxOTHERVALUE -classpath something -jar \bla\blah.jar[/code]

If you’'re using a script to start Wildfire, you can make simillar changes in that script.

Also note that you probably want to have a much smaller value for Xss than you specified. You’'re reserving that amount of memory (you specified Megabytes, not kilobytes) for each thread!