MySQL, Oracle, Linux, 软件架构及大数据技术知识分享平台

网站首页 > linux / 正文

linux 查看当前应用内存状况,以及内存参数含义

2024-11-26 15:16 huorong linux 6 ℃ 0 评论

1、查看进程号

ps -ef | grep tomcat

2、查看当前内存分配,200ms打印一次

jstat -gc 进程号 200 1
jstat -gc 34480 200 1
 S0C    S1C    S0U    S1U      EC       EU        OC         OU       MC     MU    CCSC   CCSU   YGC     YGCT    FGC    FGCT     GCT   
14848.0 15360.0 10907.4  0.0   2699776.0 927300.9 1175040.0   636762.8  276908.0 238024.6 31148.0 26766.2   3510   72.635   6      2.610   75.245
S0C:第一个幸存区的大小
S1C:第二个幸存区的大小
S0U:第一个幸存区的使用大小
S1U:第二个幸存区的使用大小
EC:伊甸园区的大小
EU:伊甸园区的使用大小
OC:老年代大小
OU:老年代使用大小
MC:方法区大小
MU:方法区使用大小
CCSC:压缩类空间大小
CCSU:压缩类空间使用大小
YGC:年轻代垃圾回收次数
YGCT:年轻代垃圾回收消耗时间
FGC:老年代垃圾回收次数
FGCT:老年代垃圾回收消耗时间
GCT:垃圾回收消耗总时间

3、查看当前堆使用情况

jmap -heap 34480
Attaching to process ID 34480, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.192-b12

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

Heap Configuration:
   MinHeapFreeRatio         = 0
   MaxHeapFreeRatio         = 100
   MaxHeapSize              = 8388608000 (8000.0MB)
   NewSize                  = 174587904 (166.5MB)
   MaxNewSize               = 2796027904 (2666.5MB)
   OldSize                  = 349700096 (333.5MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 0 (0.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 2764570624 (2636.5MB)
   used     = 1962159688 (1871.2612991333008MB)
   free     = 802410936 (765.2387008666992MB)
   70.97520573234594% used
From Space:
   capacity = 15204352 (14.5MB)
   used     = 11169176 (10.651756286621094MB)
   free     = 4035176 (3.8482437133789062MB)
   73.46038818359375% used
To Space:
   capacity = 15728640 (15.0MB)
   used     = 0 (0.0MB)
   free     = 15728640 (15.0MB)
   0.0% used
PS Old Generation
   capacity = 1203240960 (1147.5MB)
   used     = 652045072 (621.8386383056641MB)
   free     = 551195888 (525.6613616943359MB)
   54.19073100702955% used

88789 interned Strings occupying 9011304 bytes.

从23行heap usage 就可以看到当前堆的状况

Tags:查看linux内存使用情况

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言