使用ps -ef | grep port 查找出具体tomcat的pid,然后使用 jmap -heap pid就可以看出整个对内存的使用情况了:

[tomcat@hch_test_web_1_24 home]$ jmap -heap 23710
Attaching to process ID 23710, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.55-b03

using thread-local object allocation.
Parallel GC with 18 thread(s)

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 2147483648 (2048.0MB)
   NewSize          = 1310720 (1.25MB)
   MaxNewSize       = 17592186044415 MB
   OldSize          = 5439488 (5.1875MB)
   NewRatio         = 2
   SurvivorRatio    = 8
   PermSize         = 536870912 (512.0MB)
   MaxPermSize      = 2147483648 (2048.0MB)
   G1HeapRegionSize = 0 (0.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 535298048 (510.5MB)
   used     = 309708648 (295.3611831665039MB)
   free     = 225589400 (215.1388168334961MB)
   57.857234704506155% used
From Space:
   capacity = 89128960 (85.0MB)
   used     = 19648888 (18.73863983154297MB)
   free     = 69480072 (66.26136016845703MB)
   22.04545862534467% used
To Space:
   capacity = 85458944 (81.5MB)
   used     = 0 (0.0MB)
   free     = 85458944 (81.5MB)
   0.0% used
PS Old Generation
   capacity = 1431830528 (1365.5MB)
   used     = 311125312 (296.71221923828125MB)
   free     = 1120705216 (1068.7877807617188MB)
   21.729199504817373% used
PS Perm Generation
   capacity = 536870912 (512.0MB)
   used     = 212898400 (203.03573608398438MB)
   free     = 323972512 (308.9642639160156MB)
   39.6554172039032% used

34822 interned Strings occupying 3865248 bytes.
带符号 * 的表示必填项