Reputation: 111
After few days of running my java app on tomcat I get 100% CPU load on tomcat process. I did jmap
to detect full memory. The app still process all incomming TCP request but does not start Web page (beacuse of full memory)
Why is CPU to 100%? Because of running Java Garbage Collector? But why it takes several hours? I have had to kill the process manualy a start tomcat again.
How to better setup tomcat memory with parameters Xms
or Xmx
?
using thread-local object allocation.
Parallel GC with 2 thread(s)
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 1073741824 (1024.0MB)
NewSize = 1310720 (1.25MB)
MaxNewSize = 17592186044415 MB
OldSize = 5439488 (5.1875MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 21757952 (20.75MB)
MaxPermSize = 536870912 (512.0MB)
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 84410368 (80.5MB)
used = 84410368 (80.5MB)
free = 0 (0.0MB)
100.0% used
From Space:
capacity = 3670016 (3.5MB)
used = 0 (0.0MB)
free = 3670016 (3.5MB)
0.0% used
To Space:
capacity = 3670016 (3.5MB)
used = 0 (0.0MB)
free = 3670016 (3.5MB)
0.0% used
PS Old Generation
capacity = 715653120 (682.5MB)
used = 715497816 (682.3518905639648MB)
free = 155304 (0.14810943603515625MB)
99.97829898373111% used
PS Perm Generation
capacity = 78643200 (75.0MB)
used = 78253152 (74.62802124023438MB)
free = 390048 (0.371978759765625MB)
99.5040283203125% used
31605 interned Strings occupying 3556200 bytes.
Upvotes: 0
Views: 521
Reputation: 2805
As said in comments, when memory gets bursted in this way, this could probably be caused by a memory leak.
The only way to detect this is with dedicated tools.
I suggest you to use JProfiler , you can find a guide here on how to find a memory leak.
Hope this helps :)
Upvotes: 1