Java 500M的表放在HashMap里面大约占用内存多大?给多大内存最保险?
测试1、给 java -Xms2048m -Xmx2048m
运行结果,系统CPU占用很大,GC全局回收比较厉害。
GC: Scavenge GC - Reason started: Eden full - parallel with thread number: 8
GC: Scav 7.613 s Since start of previous GC: 7.613 s GC time: 0.572 s
Time spent executing application: 7.613 s (93.02%)
Object size causing failure: 48 bytes MaxTenure: 7
Eden: 536870912->48/536870912
Survivor: 0->88072136/88080384 (survivor used: 99.99%)
Old: 0->410543440/1434451968 (old used: 28.62%)
Perm: 10869592->10869592/10911744
GC: Full GC - Reason started: Allocation failure
GC: Full 14.852 s Since start of previous GC: 7.239 s GC time: 12.318 s
Time spent executing application: 6.667 s (35.12%)
**** WARNING: Too much time spent in GC (>20%)
Object size causing failure: 40 bytes MaxTenure: 7