Thursday, August 16, 2012

Show Java Heap Sizes

/opt/jdk1.6.0_16/bin/jmap -heap `ps -ef |grep java|grep start|cut -c10-15`



output:

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 1073741824 (1024.0MB)
   NewSize          = 1048576 (1.0MB)
   MaxNewSize       = 4294901760 (4095.9375MB)
   OldSize          = 4194304 (4.0MB)
   NewRatio         = 8
   SurvivorRatio    = 8
   PermSize         = 16777216 (16.0MB)
   MaxPermSize      = 67108864 (64.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 103219200 (98.4375MB)
   used     = 31150464 (29.7073974609375MB)
   free     = 72068736 (68.7301025390625MB)
   30.178943452380953% used
From Space:
   capacity = 7864320 (7.5MB)
   used     = 3225432 (3.0760116577148438MB)
   free     = 4638888 (4.423988342285156MB)
   41.01348876953125% used
To Space:
   capacity = 7471104 (7.125MB)
   used     = 0 (0.0MB)
   free     = 7471104 (7.125MB)
   0.0% used
PS Old Generation
   capacity = 954466304 (910.25MB)
   used     = 793981280 (757.1995544433594MB)
   free     = 160485024 (153.05044555664062MB)
   83.18588898031962% used
PS Perm Generation
   capacity = 23461888 (22.375MB)
   used     = 23309160 (22.229347229003906MB)
   free     = 152728 (0.14565277099609375MB)
   99.34903789498952% used