재밌는 GC 콘텐츠.
4925 단어 GC
My garbage collection logs has two different entry types for 'full gc'? One with the word 'System', the other without. What's the difference?
(Update: I searched on this term and didn't find a definitive answer, only a few questions. So I thought I'd post it).
System:
164638.058: [Full GC (System) [PSYoungGen: 22789K->0K(992448K)] [PSOldGen: 1645508K->1666990K(2097152K)] 1668298K->1666990K(3089600K) [PSPermGen: 164914K->164914K(166720K)], 5.7499132 secs] [Times: user=5.69 sys=0.06, real=5.75 secs]
No-System:
166687.013: [Full GC [PSYoungGen: 126501K->0K(922048K)] [PSOldGen: 2063794K->1598637K(2097152K)] 2190295K->1598637K(3019200K) [PSPermGen: 165840K->164249K(166016K)], 6.8204928 secs] [Times: user=6.80 sys=0.02, real=6.81 secs]
GC Options
Our gc-related java memory options are: -Xloggc:../server/pe/log/jvm_gc.log -XX:+PrintGCTimeStamps -XX:+PrintGCDetails
We do not '-XX:+DisableExplicitGC', so it's possible some errant class does call System.gc()
fwiw, our full jvm options:
-Xms3072m -Xmx3072m -XX:+HeapDumpOnOutOfMemoryError -XX:-UseGCOverheadLimit -Xloggc:../server/pe/log/jvm_gc.log -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:MaxPermSize=256m -XX:+UseCompressedOops
From the source for OpenJDK I would say it is
const bool is_system_gc = gc_cause == GCCause::_java_lang_system_gc;
// This is useful for debugging but don't change the output the
// the customer sees.
const char* gc_cause_str = "Full GC";
if (is_system_gc && PrintGCDetails) {
gc_cause_str = "Full GC (System)";
}
I created a custom version of the Runtime class to record the thread name and stack trace to a file whenever Runtime.getRuntime().gc() was called. (System.gc() calls this) I found it useful in tracking down and removing such callers.
One place this happens is in sun.misc.GC class. The RMI will ask this class to ensure a GC has been performing in the last N seconds. If there has been no GC it triggers a full GC.
This only shows as a problem if you reduce the number of minor GCs. Ironicly it can mean you get more full GCs. ;)
I don't use RMI (except perhaps JConsole) So I have it set to a week. (Think the default is an hour)
-Dsun.rmi.dgc.server.gcInterval=604800000
-Dsun.rmi.dgc.client.gcInterval=604800000
http://java.sun.com/docs/hotspot/gc1.4.2/example.html
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Java에서 쓰레기 수거기 GC가 처리량에 미치는 영향 테스트메모리 관리 용어표를 보다가 우연히 "Pig in the Python(주: 중국어의 탐욕이 뱀이 코끼리를 삼키지 못하는 것 같다)"이라는 정의를 발견하고 이 글을 쓰게 되었다.표면적으로 보면 이 용어는 GC가 끊임없...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.