Monday, November 22, 2010

Checking Java memory usage on a Linux server

A customer reported slowness in a production system, so I ran the following commands to check the state of the memory usage (since recently we had out-of-memory errors):

 

ps -ef|grep java

jmap -heap <pid>

 

 

The output:

 

Attaching to process ID 1715, please wait...

Debugger attached successfully.

Server compiler detected.

JVM version is 14.0-b16

 

using thread-local object allocation.

Parallel GC with 2 thread(s)

 

Heap Configuration:

   MinHeapFreeRatio = 40

   MaxHeapFreeRatio = 70

   MaxHeapSize      = 2015363072 (1922.0MB)

   NewSize          = 2686976 (2.5625MB)

   MaxNewSize       = 17592186044415 MB

   OldSize          = 5439488 (5.1875MB)

   NewRatio         = 2

   SurvivorRatio    = 8

   PermSize         = 21757952 (20.75MB)

   MaxPermSize      = 134217728 (128.0MB)

 

Heap Usage:

PS Young Generation

Eden Space:

   capacity = 368246784 (351.1875MB)

   used     = 259936376 (247.89464569091797MB)

   free     = 108310408 (103.29285430908203MB)

   70.58754815900849% used

From Space:

   capacity = 11534336 (11.0MB)

   used     = 11502000 (10.969161987304688MB)

   free     = 32336 (0.0308380126953125MB)

   99.71965443004261% used

To Space:

   capacity = 12451840 (11.875MB)

   used     = 0 (0.0MB)

   free     = 12451840 (11.875MB)

   0.0% used

PS Old Generation

   capacity = 122290176 (116.625MB)

   used     = 76169032 (72.64044952392578MB)

   free     = 46121144 (43.98455047607422MB)

   62.285487265959944% used

PS Perm Generation

   capacity = 88211456 (84.125MB)

   used     = 39361424 (37.53797912597656MB)

   free     = 48850032 (46.58702087402344MB)

   44.62166909477155% used

 

No comments: