java - JVM GC problems -


in last few weeks have been testing different jvm setting glassfish server. main settings heap (among others) are: -xms512m, -xmx512m, -xx:newratio=2. tried different gc setting still have problems long pauses after few days starting server. noticed following:
1. -xx:+useparallelgc -xx:+useparalleloldgc - minor gc occuring every minute, major gc every 18 hours. had no problems minor gc there problems major gc after 5 days. @ first major gc pauses lasted 100-200ms @ end last pause lasted 70 seconds.
2. -xx:+useconcmarksweepgc -xx:+useparnewgc - same above. minor gc fine, major gc (not full) pauses getting long. noticed problems high class unloading @ gc (cms final remark) phase stop world phase.
3. -xx:+useconcmarksweepgc -xx:+useparnewgc , -xx:maxgcpausemillis=5000. testing day because second major gc last (not full) lasted 20 seconds thought there else wrong.
4. -xx:+useg1gc, -xx:maxgcpausemillis=5000, -xx:+usestringdeduplication without -xx:newratio=2 option - major gc (not full) occurring every 12 hours, have noticed problems already:

2015-05-31t18:25:25.145+0200: 83383.897: [gc concurrent-mark-start] 2015-05-31t18:25:35.563+0200: 83394.312: [gc concurrent-mark-end, 10.4145795 secs] 2015-05-31t18:25:35.563+0200: 83394.312: [gc remark 83394.312: [finalize marking, 0.0002939 secs] 83394.312: [gc ref-proc, 1.2128584 secs] 83395.525: [unloading, 14.5180500 secs], 15.7320854 secs]  [times: user=0.14 sys=0.22, real=15.73 secs]  

gc remark phase took 15 seconds not acceptable me. can see unloading took of time. happened before when using other gc think there must problem class unloading.

summary: gc run ok time after few days problems started appear long pause times. don't know why working fine first few days , results bad. noticed higher pause time caused class unloading wondering if there setting better results. want know gc recommending me use? have internal web application running on glassfish server on pc 8gb of ram, i7 processor , windows 8 operating system. there max 10 clients connection @ same time must have long uptime , there can not long pause times (max 5 seconds). please advise me else can shorter pause times.

and 1 more question: disadvantage using g1gc instead of cms or parallelgc in case? heap small use g1gc?

edit: g1gc log right before , after long pause gc remark phase

2015-05-31t18:25:25.004+0200: 83383.755: [gc pause (g1 evacuation pause) (young) (initial-mark), 0.1280453 secs]    [parallel time: 116.2 ms, gc workers: 4]       [gc worker start (ms): min: 83383757.6, avg: 83383757.7, max: 83383757.7, diff: 0.0]       [ext root scanning (ms): min: 97.8, avg: 98.3, max: 98.5, diff: 0.7, sum: 393.1]       [update rs (ms): min: 0.2, avg: 4.0, max: 14.8, diff: 14.6, sum: 16.1]          [processed buffers: min: 1, avg: 6.0, max: 16, diff: 15, sum: 24]       [scan rs (ms): min: 0.0, avg: 0.0, max: 0.1, diff: 0.1, sum: 0.1]       [code root scanning (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.0]       [object copy (ms): min: 0.2, avg: 2.5, max: 3.7, diff: 3.5, sum: 10.2]       [termination (ms): min: 0.0, avg: 8.5, max: 11.4, diff: 11.4, sum: 34.2]       [gc worker other (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.0]       [gc worker total (ms): min: 113.4, avg: 113.4, max: 113.5, diff: 0.0, sum: 453.8]       [gc worker end (ms): min: 83383871.1, avg: 83383871.1, max: 83383871.1, diff: 0.0]    [code root fixup: 0.1 ms]    [code root purge: 0.0 ms]    [string dedup fixup: 2.2 ms, gc workers: 4]       [queue fixup (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.0]       [table fixup (ms): min: 2.0, avg: 2.1, max: 2.1, diff: 0.1, sum: 8.3]    [clear ct: 0.1 ms]    [other: 9.5 ms]       [choose cset: 0.0 ms]       [ref proc: 8.8 ms]       [ref enq: 0.1 ms]       [redirty cards: 0.3 ms]       [humongous reclaim: 0.0 ms]       [free cset: 0.1 ms]    [eden: 215.0m(215.0m)->0.0b(215.0m) survivors: 7168.0k->7168.0k heap: 451.5m(512.0m)->236.6m(512.0m)]  [times: user=0.08 sys=0.02, real=0.13 secs]  2015-05-31t18:25:25.129+0200: 83383.883: [gc concurrent-root-region-scan-start] 2015-05-31t18:25:25.129+0200: 83383.883: [gc concurrent-string-deduplication, 160.0b->0.0b(160.0b), avg 48.3%, 0.0000070 secs]    [last exec: 0.0000070 secs, idle: 23.1834927 secs, blocked: 0/0.0000000 secs]       [inspected:               3]          [skipped:              0(  0.0%)]          [hashed:               3(100.0%)]          [known:                0(  0.0%)]          [new:                  3(100.0%)    160.0b]       [deduplicated:            3(100.0%)    160.0b(100.0%)]          [young:                3(100.0%)    160.0b(100.0%)]          [old:                  0(  0.0%)      0.0b(  0.0%)]    [total exec: 2868/0.1946124 secs, idle: 2868/83382.9701762 secs, blocked: 13/0.0032760 secs]       [inspected:          304493]          [skipped:              0(  0.0%)]          [hashed:          163708( 53.8%)]          [known:            44808( 14.7%)]          [new:             259685( 85.3%)     21.9m]       [deduplicated:       160467( 61.8%)     10.6m( 48.3%)]          [young:            83546( 52.1%)   6270.6k( 57.8%)]          [old:              76921( 47.9%)   4571.3k( 42.2%)]    [table]       [memory usage: 4291.8k]       [size: 131072, min: 1024, max: 16777216]       [entries: 133319, load: 101.7%, cached: 6107, added: 142389, removed: 9070]       [resize count: 7, shrink threshold: 87381(66.7%), grow threshold: 262144(200.0%)]       [rehash count: 0, rehash threshold: 120, hash seed: 0x0]       [age threshold: 3]    [queue]       [dropped: 0] 2015-05-31t18:25:25.145+0200: 83383.897: [gc concurrent-root-region-scan-end, 0.0140467 secs] 2015-05-31t18:25:25.145+0200: 83383.897: [gc concurrent-mark-start] 2015-05-31t18:25:35.563+0200: 83394.312: [gc concurrent-mark-end, 10.4145795 secs] 2015-05-31t18:25:35.563+0200: 83394.312: [gc remark 83394.312: [finalize marking, 0.0002939 secs] 83394.312: [gc ref-proc, 1.2128584 secs] 83395.525: [unloading, 14.5180500 secs], 15.7320854 secs]  [times: user=0.14 sys=0.22, real=15.73 secs]  2015-05-31t18:25:51.288+0200: 83410.045: [gc cleanup 334m->326m(512m), 0.2836092 secs]  [times: user=0.00 sys=0.00, real=0.28 secs]  2015-05-31t18:25:51.570+0200: 83410.328: [gc concurrent-cleanup-start] 2015-05-31t18:25:51.570+0200: 83410.328: [gc concurrent-cleanup-end, 0.0000669 secs] 2015-05-31t18:26:03.732+0200: 83422.482: [gc pause (g1 evacuation pause) (young), 0.1031257 secs]    [parallel time: 91.6 ms, gc workers: 4]       [gc worker start (ms): min: 83422481.7, avg: 83422481.7, max: 83422481.8, diff: 0.0]       [ext root scanning (ms): min: 1.3, avg: 1.7, max: 2.7, diff: 1.4, sum: 6.9]       [update rs (ms): min: 0.0, avg: 22.7, max: 89.8, diff: 89.8, sum: 90.8]          [processed buffers: min: 0, avg: 7.3, max: 15, diff: 15, sum: 29]       [scan rs (ms): min: 0.0, avg: 0.0, max: 0.1, diff: 0.1, sum: 0.2]       [code root scanning (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.0]       [object copy (ms): min: 0.5, avg: 2.4, max: 3.4, diff: 2.9, sum: 9.5]       [termination (ms): min: 0.0, avg: 64.7, max: 86.3, diff: 86.3, sum: 258.9]       [gc worker other (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.1]       [gc worker total (ms): min: 91.6, avg: 91.6, max: 91.6, diff: 0.0, sum: 366.3]       [gc worker end (ms): min: 83422573.3, avg: 83422573.3, max: 83422573.3, diff: 0.0]    [code root fixup: 0.1 ms]    [code root purge: 0.0 ms]    [string dedup fixup: 2.1 ms, gc workers: 4]       [queue fixup (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.0]       [table fixup (ms): min: 1.9, avg: 1.9, max: 1.9, diff: 0.1, sum: 7.7]    [clear ct: 0.1 ms]    [other: 9.3 ms]       [choose cset: 0.0 ms]       [ref proc: 8.8 ms]       [ref enq: 0.1 ms]       [redirty cards: 0.0 ms]       [humongous reclaim: 0.0 ms]       [free cset: 0.1 ms]    [eden: 215.0m(215.0m)->0.0b(19.0m) survivors: 7168.0k->6144.0k heap: 443.6m(512.0m)->228.2m(512.0m)]  [times: user=0.30 sys=0.01, real=0.10 secs]  2015-05-31t18:26:03.848+0200: 83422.597: [gc concurrent-string-deduplication, 160.0b->0.0b(160.0b), avg 48.3%, 0.0123951 secs]    [last exec: 0.0123951 secs, idle: 38.7017788 secs, blocked: 0/0.0000000 secs]       [inspected:               3]          [skipped:              0(  0.0%)]          [hashed:               3(100.0%)]          [known:                0(  0.0%)]          [new:                  3(100.0%)    160.0b]       [deduplicated:            3(100.0%)    160.0b(100.0%)]          [young:                3(100.0%)    160.0b(100.0%)]          [old:                  0(  0.0%)      0.0b(  0.0%)]    [total exec: 2869/0.2070075 secs, idle: 2869/83421.6719550 secs, blocked: 13/0.0032760 secs]       [inspected:          304496]          [skipped:              0(  0.0%)]          [hashed:          163711( 53.8%)]          [known:            44808( 14.7%)]          [new:             259688( 85.3%)     21.9m]       [deduplicated:       160470( 61.8%)     10.6m( 48.3%)]          [young:            83549( 52.1%)   6270.8k( 57.8%)]          [old:              76921( 47.9%)   4571.3k( 42.2%)]    [table]       [memory usage: 2565.5k]       [size: 65536, min: 1024, max: 16777216]       [entries: 81061, load: 123.7%, cached: 6553, added: 142396, removed: 61335]       [resize count: 8, shrink threshold: 43690(66.7%), grow threshold: 131072(200.0%)]       [rehash count: 0, rehash threshold: 120, hash seed: 0x0]       [age threshold: 3]    [queue]       [dropped: 0] 2015-05-31t18:26:05.769+0200: 83424.518: [gc pause (g1 evacuation pause) (mixed), 0.2232916 secs]    [parallel time: 216.7 ms, gc workers: 4]       [gc worker start (ms): min: 83424518.3, avg: 83424518.3, max: 83424518.3, diff: 0.0]       [ext root scanning (ms): min: 1.2, avg: 1.6, max: 2.6, diff: 1.4, sum: 6.5]       [update rs (ms): min: 0.0, avg: 0.3, max: 0.4, diff: 0.4, sum: 1.2]          [processed buffers: min: 0, avg: 4.3, max: 7, diff: 7, sum: 17]       [scan rs (ms): min: 56.1, avg: 102.3, max: 144.4, diff: 88.3, sum: 409.2]       [code root scanning (ms): min: 0.0, avg: 0.1, max: 0.2, diff: 0.2, sum: 0.3]       [object copy (ms): min: 50.4, avg: 97.6, max: 157.7, diff: 107.2, sum: 390.2]       [termination (ms): min: 0.0, avg: 14.8, max: 19.8, diff: 19.8, sum: 59.1]       [gc worker other (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.1]       [gc worker total (ms): min: 216.6, avg: 216.6, max: 216.6, diff: 0.0, sum: 866.5]       [gc worker end (ms): min: 83424734.9, avg: 83424734.9, max: 83424734.9, diff: 0.0]    [code root fixup: 0.1 ms]    [code root purge: 0.0 ms]    [string dedup fixup: 1.5 ms, gc workers: 4]       [queue fixup (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.0]       [table fixup (ms): min: 1.4, avg: 1.4, max: 1.4, diff: 0.0, sum: 5.6]    [clear ct: 0.2 ms]    [other: 4.8 ms]       [choose cset: 0.0 ms]       [ref proc: 0.9 ms]       [ref enq: 0.0 ms]       [redirty cards: 0.2 ms]       [humongous reclaim: 0.0 ms]       [free cset: 0.2 ms]    [eden: 19.0m(19.0m)->0.0b(21.0m) survivors: 6144.0k->4096.0k heap: 247.2m(512.0m)->175.2m(512.0m)]  [times: user=0.09 sys=0.00, real=0.22 secs]  2015-05-31t18:26:05.992+0200: 83424.742: [gc concurrent-string-deduplication, 640.0b->152.0b(488.0b), avg 48.3%, 0.0000246 secs]    [last exec: 0.0000246 secs, idle: 2.1442834 secs, blocked: 0/0.0000000 secs]       [inspected:               6]          [skipped:              0(  0.0%)]          [hashed:               5( 83.3%)]          [known:                0(  0.0%)]          [new:                  6(100.0%)    640.0b]       [deduplicated:            5( 83.3%)    488.0b( 76.3%)]          [young:                5(100.0%)    488.0b(100.0%)]          [old:                  0(  0.0%)      0.0b(  0.0%)]    [total exec: 2870/0.2070321 secs, idle: 2870/83423.8162384 secs, blocked: 13/0.0032760 secs]       [inspected:          304502]          [skipped:              0(  0.0%)]          [hashed:          163716( 53.8%)]          [known:            44808( 14.7%)]          [new:             259694( 85.3%)     21.9m]       [deduplicated:       160475( 61.8%)     10.6m( 48.3%)]          [young:            83554( 52.1%)   6271.2k( 57.8%)]          [old:              76921( 47.9%)   4571.3k( 42.2%)]    [table]       [memory usage: 2564.6k]       [size: 65536, min: 1024, max: 16777216]       [entries: 81026, load: 123.6%, cached: 6553, added: 142397, removed: 61371]       [resize count: 8, shrink threshold: 43690(66.7%), grow threshold: 131072(200.0%)]       [rehash count: 0, rehash threshold: 120, hash seed: 0x0]       [age threshold: 3]    [queue]       [dropped: 0] 2015-05-31t18:26:08.157+0200: 83426.906: [gc pause (g1 evacuation pause) (mixed), 0.6216666 secs]    [parallel time: 618.5 ms, gc workers: 4]       [gc worker start (ms): min: 83426906.5, avg: 83426906.5, max: 83426906.5, diff: 0.0]       [ext root scanning (ms): min: 0.3, avg: 8.0, max: 15.7, diff: 15.3, sum: 31.9]       [update rs (ms): min: 0.0, avg: 4.5, max: 8.5, diff: 8.5, sum: 17.9]          [processed buffers: min: 0, avg: 7.0, max: 18, diff: 18, sum: 28]       [scan rs (ms): min: 13.4, avg: 28.4, max: 65.2, diff: 51.8, sum: 113.7]       [code root scanning (ms): min: 0.0, avg: 0.0, max: 0.1, diff: 0.1, sum: 0.2]       [object copy (ms): min: 532.6, avg: 577.3, max: 604.5, diff: 71.9, sum: 2309.1]       [termination (ms): min: 0.0, avg: 0.2, max: 0.3, diff: 0.3, sum: 0.7]       [gc worker other (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.1]       [gc worker total (ms): min: 618.4, avg: 618.4, max: 618.4, diff: 0.0, sum: 2473.6]       [gc worker end (ms): min: 83427524.9, avg: 83427524.9, max: 83427524.9, diff: 0.0]    [code root fixup: 0.1 ms]    [code root purge: 0.0 ms]    [string dedup fixup: 1.3 ms, gc workers: 4]       [queue fixup (ms): min: 0.0, avg: 0.0, max: 0.0, diff: 0.0, sum: 0.0]       [table fixup (ms): min: 1.2, avg: 1.2, max: 1.3, diff: 0.1, sum: 4.9]    [clear ct: 0.1 ms]    [other: 1.6 ms]       [choose cset: 0.0 ms]       [ref proc: 1.0 ms]       [ref enq: 0.0 ms]       [redirty cards: 0.0 ms]       [humongous reclaim: 0.0 ms]       [free cset: 0.2 ms]    [eden: 21.0m(21.0m)->0.0b(21.0m) survivors: 4096.0k->4096.0k heap: 196.2m(512.0m)->129.4m(512.0m)]  [times: user=0.08 sys=0.02, real=0.62 secs]  

edit: results after few hours:

enter image description here

enter image description here

there lot of pages/sec , pages input/sec , page fault. normal? can set monitor pages/sec , pages input/sec jvm (i found pages faults)?

i'd guess you're barking wrong tree - suspect garbage collection not problem...

you're running 512 mib heap - me, long pause heap size 1 or 2 seconds. major pauses in milliseconds possible huge (32 gib) heaps.

i'm expecting issue server - either other applications you've mentioned using enough memory push java process (which around 50% bigger heap) swap / virtual memory - or you're running application in virtualised environment (possibly memory overcommitment / memory balooning issues).

as crude indicator, gc algorithm should able churn though 100 mib of heap per second - if you're seeing worse that, elsewhere cause of issue.

in case, believe gc symptom, not problem.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -