2回复
1年前
容器内存溢出
问题描述:
某一个系统生产环境java进程占用2.3GB内存,但是堆的最大内存1.5GB,等超过容器内存2.5之后导致容器会重启,启动参数为:-Xms1536M -Xmx1536M --XX:NativeMemoryTracking=detail -Xss256k -XX:MaxDirectMemorySize=1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:CompressedClassSpaceSize=256m -XX:ReservedCodeCacheSize=256m -XX:MaxRAMPercentage=45 -XX:InitialRAMPercentage=45 -javaagent:xxx
启动后1.5G到2.3G对比:
Native Memory Tracking:
(Omitting categories weighting less than 1MB)
Total: reserved=2479MB +11MB, committed=2009MB +28MB
- Java Heap (reserved=1536MB, committed=1536MB)
(mmap: reserved=1536MB, committed=1536MB)
- Class (reserved=259MB, committed=25MB +1MB)
(classes #34740 +1111)
( instance classes #32624 +1069, array classes #2116 +42)
(malloc=3MB #81814 +7837)
(mmap: reserved=256MB, committed=22MB +1MB)
: ( Metadata)
( reserved=152MB +8MB, committed=146MB +7MB)
( used=146MB +7MB)
( waste=1MB =0.42%)
: ( Class space)
( reserved=256MB, committed=22MB +1MB)
( used=21MB +1MB)
( waste=1MB =2.84%)
- Thread (reserved=55MB, committed=19MB)
(thread #0)
(stack: reserved=55MB, committed=18MB)
- Code (reserved=263MB +2MB, committed=70MB +19MB)
(malloc=5MB +2MB #23580 +3551)
(mmap: reserved=258MB, committed=65MB +18MB)
- GC (reserved=101MB, committed=101MB)
(malloc=12MB #37365 +7177)
(mmap: reserved=89MB, committed=89MB)
- Compiler (reserved=1MB, committed=1MB)
(malloc=1MB #2339 +127)
- Internal (reserved=4MB +1MB, committed=4MB +1MB)
(malloc=4MB +1MB #41556 +11725)
- Other (reserved=37MB, committed=37MB)
(malloc=37MB #182 +15)
- Symbol (reserved=37MB +1MB, committed=37MB +1MB)
(malloc=35MB +1MB #887891 +22181)
(arena=2MB #1)
- Native Memory Tracking (reserved=17MB +1MB, committed=17MB +1MB)
(malloc=1MB #10625 +4822)
(tracking overhead=17MB +1MB)
- Shared class space (reserved=12MB, committed=12MB)
(mmap: reserved=12MB, committed=12MB)
- Arena Chunk (reserved=1MB -3MB, committed=1MB -3MB)
(malloc=1MB -3MB)
- Module (reserved=1MB, committed=1MB)
(malloc=1MB #4798 +80)
- Metaspace (reserved=153MB +8MB, committed=147MB +7MB)
(malloc=1MB #666 +33)
(mmap: reserved=152MB +8MB, committed=146MB +7MB)
1475 阅读