3

JBoss throws OOME when user tries to log in though there's tons of memory! JBoss has been up for about 55 hours with the following settings:

-Xms1024m
-Xmx1536m
-XX:MaxPermSize=256m
-Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000
-Xss256k
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled
-XX:HeapDumpPath=../heapdump.hprof
-XX:+HeapDumpOnOutOfMemoryError
-Djava.net.preferIPv4Stack=true

According to JVisualVm the used memory is about 950M. This means that more than 500M is still available for allocation. However all attempts to log-in results in "java.lang.OutOfMemoryError: Java heap space"!

2
  • During the login, could it be calling a separate process running with a much lower heap setting? Commented Jan 9, 2012 at 19:34
  • Remove -Xss256k and I bet your error goes away. Commented Jan 9, 2012 at 19:40

2 Answers 2

1

There may be high possibility that while logging on, instantiated resource might be exceeding than available/allocated memory. I would suggest do thread dump analysis for login, which may give you more information. Here is SO link on how to do thread dump analysis. Thread dump analysis on jboss

I would check while login attempts how much exact value JVisualVM showing. Did you pick Jboss process for VisualVM display?

Sign up to request clarification or add additional context in comments.

Comments

1

You can run out of memory if it ties to place an object into a space which for some reason it is unable to re-size. e.g. large objects are added straight into the old gen space. If the old gen space is full, but the eden or survivor spaces are not quite full, you can get an Out of heap space.

If you are using the concurrent mark sweep collector you can have fragmented old generation memory. This is because this generation doesn't de-fragment. e.g. say you have every 1 KB used and every second free, you can have 50% of memory free and yet moving a 2 KB object to old gen can fail.

If you are getting a lot of fragmentation in the old gen, I would suggest increasing the size of your new generation. This should reduce the number of medium termed objects getting into the old gen, resulting in a fragmentation when its freed.

Another unlikely possibility is you are trying to create a 600MB object. This fails and the memory used never need exceed 950 MB.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.