Reputation: 21
Heap Usage (mb)
Metric Actual
Max:
8126
Used:
2526
(31%)
Committed:
8126
Init:
8192
Non Heap Usage (mb)
Metric Actual
Max:
2144
Used:
200
(9%)
Committed:
326
Init:
23
Thread Usage
Need Help?
Metric Actual
Live:
585
Daemon:
557 (95%)
I've already setup my server using these configuration:
set "JAVA_OPTS=-Xms8g -Xmx8g -XX:MaxPermSize=2g -XX:+UseParallelGC"
set "JAVA_OPTS=%JAVA_OPTS% -Djava.net.preferIPv4Stack=true"
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman"
My problem is that sometimes the server will hang on itself and I need to restart it manually. Thread Usage always above 90% when the server started. Is it normal? What should I do to avoid this kind of problem and what are the causes ?
Upvotes: 0
Views: 294
Reputation: 4604
-XX:MaxPermSize=2g
This is very high
-Xms8g -Xmx8g -XX:+UseParallelGC"
This accepts 8 second full GC pauses.
Thread Usage always above 90% when the server started
What do you mean by this?
Then you'll need to figure out what happens when "hang on itself". Check the CPU usage of the Java process when this happens. When there is no almost usage it could be a deadlock or the application could waiting on something else. A thread dump will help you here. When it is high it could either be Java or GC related. Have a look at gc logs and run a profiler like async-profiler. Also have a look at other system activity like swapping.
Upvotes: 1
Reputation: 647
Try disabling explicit GC collection and run your own GC . In this way , the unwanted and unused garbage will be cleared . Something like this:(Sample config for Jboss + 8Gb RAM server with a web app)
JAVA_OPTS="-server -Xms7800m -Xmx7800m -XX:NewSize=5632m -XX:MaxNewSize=5632m -XX:+UseParNewGC -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:+CMSParallelRemarkEnabled -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=50 -XX:+UseCMSInitiatingOccupancyOnly -XX:ConcGCThreads=4 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/mydirectory/project/projectgclog-$(date +%Y_%m_%d-%H_%M).log -XX:+DisableExplicitGC -Djava.net.preferIPv4Stack=true"
By this way , my server periodically sweeps out the unwanted garbage and lets the server run without any error. Hope this helps.
Upvotes: 0