jvm 대상자가 오래 살아남아 노년층에 들어가지 못하게 하는 방법
3315 단어 jvm(Hotspot)
[root@ ~]# jmap -heap 20416
Attaching to process ID 20416, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.75-b04
using thread-local object allocation.
Parallel GC with 13 thread(s)
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 17179869184 (16384.0MB)
NewSize = 1310720 (1.25MB)
MaxNewSize = 8589934592 (8192.0MB)
OldSize = 5439488 (5.1875MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 1073741824 (1024.0MB)
MaxPermSize = 2147483648 (2048.0MB)
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 8058306560 (7685.0MB)
used = 6041346448 (5761.476943969727MB)
free = 2016960112 (1923.5230560302734MB)
74.97042217267048% used
From Space:
capacity = 257425408 (245.5MB)
used = 109640088 (104.5609359741211MB)
free = 147785320 (140.9390640258789MB)
42.591012616749936% used
To Space:
capacity = 251658240 (240.0MB)
used = 0 (0.0MB)
free = 251658240 (240.0MB)
0.0% used
PS Old Generation
capacity = 8589934592 (8192.0MB)
used = 406966904 (388.11388397216797MB)
free = 8182967688 (7803.886116027832MB)
4.7377183102071285% used
PS Perm Generation
capacity = 1073741824 (1024.0MB)
used = 80500800 (76.77154541015625MB)
free = 993241024 (947.2284545898438MB)
7.497221231460571% used
37957 interned Strings occupying 4116240 bytes.
이것은 현재 jvm 메모리 사용 상황입니다
10분 후 jvm 메모리 사용:
[root@ ~]# jmap -heap 20416
Attaching to process ID 20416, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.75-b04
using thread-local object allocation.
Parallel GC with 13 thread(s)
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 17179869184 (16384.0MB)
NewSize = 1310720 (1.25MB)
MaxNewSize = 8589934592 (8192.0MB)
OldSize = 5439488 (5.1875MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 1073741824 (1024.0MB)
MaxPermSize = 2147483648 (2048.0MB)
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 8095531008 (7720.5MB)
used = 786751672 (750.3048629760742MB)
free = 7308779336 (6970.195137023926MB)
9.718345482495618% used
From Space:
capacity = 251658240 (240.0MB)
used = 101936776 (97.21448516845703MB)
free = 149721464 (142.78551483154297MB)
40.506035486857094% used
To Space:
capacity = 242745344 (231.5MB)
used = 0 (0.0MB)
free = 242745344 (231.5MB)
0.0% used
PS Old Generation
capacity = 8589934592 (8192.0MB)
used = 506258872 (482.8060836791992MB)
free = 8083675720 (7709.193916320801MB)
5.8936289511621% used
PS Perm Generation
capacity = 1073741824 (1024.0MB)
used = 80501720 (76.77242279052734MB)
free = 993240104 (947.2275772094727MB)
7.497306913137436% used
37900 interned Strings occupying 4111744 bytes.
너무 큰 jvm 메모리의 비용과 대상의 대량 생존이 반드시 노년 지역에 들어가는 것은 아니다.왜냐하면survivor와 Eden의 크기를 설정할 수 있기 때문이다.그리고threshold의 값을 설정할 수 있습니다.threshold는 높은 점(예를 들어 30)을 설정하고 Eden은 8G,survivor는 500M을 설정합니다.