Dopo aver eseguito diverse ore, il mio server http inizia frequentemente con maggiore gc, ma nessun heap è stato liberato.frequente maggiore gc ma non heap libero?
più volte maggiore gc dopo, promotion failed
e concurrent mode failure
, quindi l'heap è stato liberato. Il mio registro gc è qui sotto:
{Heap before GC invocations=7172 (full 720):
par new generation total 737280K, used 667492K [0x000000076b800000, 0x000000079d800000, 0x000000079d800000)
eden space 655360K, 100% used [0x000000076b800000, 0x0000000793800000, 0x0000000793800000)
from space 81920K, 14% used [0x0000000793800000, 0x00000007943d91d0, 0x0000000798800000)
to space 81920K, 0% used [0x0000000798800000, 0x0000000798800000, 0x000000079d800000)
concurrent mark-sweep generation total 1482752K, used 1479471K [0x000000079d800000, 0x00000007f8000000, 0x00000007f8000000)
concurrent-mark-sweep perm gen total 131072K, used 58091K [0x00000007f8000000, 0x0000000800000000, 0x0000000800000000)
2015-11-19T21:50:02.692+0800: 113963.532: [GC2015-11-19T21:50:02.692+0800: 113963.532: [ParNew (promotion failed)
Desired survivor size 41943040 bytes, new threshold 15 (max 15)
- age 1: 3826144 bytes, 3826144 total
- age 2: 305696 bytes, 4131840 total
- age 3: 181416 bytes, 4313256 total
- age 4: 940632 bytes, 5253888 total
- age 5: 88368 bytes, 5342256 total
- age 6: 159840 bytes, 5502096 total
- age 7: 733856 bytes, 6235952 total
- age 8: 64712 bytes, 6300664 total
- age 9: 314304 bytes, 6614968 total
- age 10: 587160 bytes, 7202128 total
- age 11: 38728 bytes, 7240856 total
- age 12: 221160 bytes, 7462016 total
- age 13: 648376 bytes, 8110392 total
- age 14: 33296 bytes, 8143688 total
- age 15: 380768 bytes, 8524456 total
: 667492K->665908K(737280K), 0.7665810 secs]2015-11-19T21:50:03.459+0800: 113964.299: [CMS2015-11-19T21:50:05.161+0800: 113966.001: [CMS-concurrent-mark: 3.579/4.747 secs] [Times: user=13.41 sys=0.35, rea
l=4.75 secs]
(concurrent mode failure): 1479910K->44010K(1482752K), 4.7267420 secs] 2146964K->44010K(2220032K), [CMS Perm : 58091K->57795K(131072K)], 5.4939440 secs] [Times: user=9.07 sys=0.13, real=5.49 secs]
Heap after GC invocations=7173 (full 721):
par new generation total 737280K, used 0K [0x000000076b800000, 0x000000079d800000, 0x000000079d800000)
eden space 655360K, 0% used [0x000000076b800000, 0x000000076b800000, 0x0000000793800000)
from space 81920K, 0% used [0x0000000798800000, 0x0000000798800000, 0x000000079d800000)
to space 81920K, 0% used [0x0000000793800000, 0x0000000793800000, 0x0000000798800000)
concurrent mark-sweep generation total 1482752K, used 44010K [0x000000079d800000, 0x00000007f8000000, 0x00000007f8000000)
concurrent-mark-sweep perm gen total 131072K, used 57795K [0x00000007f8000000, 0x0000000800000000, 0x0000000800000000)
}
Sembra che il CMS GC
non ha alcun senso. Potresti spiegarmi per favore?
Questo è il mio config gc:
/usr/local/jdk1.7.0_79/bin/java
-server
-Xms2248m
-Xmx2248m
-Xmn800m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:MaxTenuringThreshold=15
-XX:+UseCMSCompactAtFullCollection
-XX:CMSFullGCsBeforeCompaction=0
-XX:+UseConcMarkSweepGC
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
-Xloggc:gc.log
-XX:+PrintHeapAtGC
-XX:+PrintTenuringDistribution
-XX:+UseFastAccessorMethods
UPDATE
C'è un task periodico dall'inizio del server. Il suo compito è caricare i dati da mysql e conservare in jvm heap. Quando arriva la richiesta del client, il server dovrebbe calcolare con i dati. Il codice di compito in questo modo:
private volatile List<ActivityInfo> activityInfos;
public void run() {
activityInfos = db.loadActivity();
}
public ActivityInfo getActivityByClient() {
//
List<ActivityInfo> local = activityInfos;
// biz code
ActivityInfo response = // biz code
return response;
}
// executor
executor.scheduleWithFixedDelay(task, 0, 1, TimeUnit.MINUTES);
Quello che mi ha confuso di più è il motivo per cui cumulo è stato liberato dopo la piena gc, non dopo importanti gc?
UPDATE
Ho confuso il motivo per cui l'heap è stato liberato dopo il pieno gc, non dopo il maggiore gc? – znlyj
Err, perché il GC completo ha liberato qualcosa che il GC principale non ha raggiunto? – EJP
L'utilizzo dell'heap dopo una raccolta principale è di soli 44 MB, quindi l'heap è già di dimensioni generose e l'aumento non sarà di aiuto. –