Is less space available, creating space for continuous renewal?

First, I will talk about some of the objects that we create. And ask a question (in the end).

I am using 64 but JVM for Linux.

My jvm options: -Xmx6g -Xms3g -XX: MaxPermSize = 256m

The profiler (jprofiler) points to 2 places that consume a lot of memory: 1) About 4 lines (each 110 KB) per second are created here, and StringUtils.replace is executed for each line. Some other string assignments, etc. are also performed, but the profiler explicitly indicates that StringUtils.replace is what holds most of the memory. 2) Here an object (saved size if 3.5 MB) containing 4 objects (of the same class) is created one minute and (re) placed in a static concurrenthashmap (so that the map contains only 1 object at any time). The entire parent object has these 4 child objects and nothing else. Each of these 4 objects contains 10K arraylists, 10K Date and other lines, etc. I explicitly assign the old parent object (the one I get from map.replace ()),to null and explicitly clearing (ArrayList.clear ()) ArrayList, etc. inside these 4 child objects.

Memory Behavior: Memory usage increases, and at some point a large collection (2 GB) occurs. a small collection (700 MB) also occurs approximately once per minute.

Question . Do you think No. 1 actually causes the eden space to fill up, and so the JVM pushes the objects in # 2 to the storage space, and so the memory usage continues to increase until a large merge occurs? For the purpose of diagnostics, I changed the parent to # 2 to save 500 KB (7 times smaller, also 1.4K instances of Date, ArrayList, etc.), and I still see the same memory behavior.

-Xmx12g -Xms3g -XX: MaxPermSize = 256m -XX: NewSize = 8g # # 2 , / . , # 2 , , (8G) 2 .

- ( ), .

, ?

+3
1

eden eden, . , , 2 .

6 (NewSize ) 3 , , , , .

, , 3 , , , -, 10 .

BTW: 10 , 6 , - mjor- .

public class GCLikeMad {
    public static void main(String... args) {
        for(Long l = 0L; l < Integer.MAX_VALUE * 10L; l++);
    }
}

-XX:NewSize=256m

[GC 295664K->240K(2121792K), 0.0011190 secs]
[GC 286832K->240K(2113216K), 0.0011510 secs]
[GC 278384K->240K(2105216K), 0.0012900 secs]
[GC 270256K->240K(2097280K), 0.0010110 secs]
[GC 262448K->240K(2257280K), 0.0013450 secs]

-XX:newSize=8g -verbosegc

[GC 6291664K->320K(7345408K), 0.0017790 secs]
[GC 6291776K->272K(7345408K), 0.0021570 secs]
[GC 6291728K->272K(7345408K), 0.0014490 secs]
[GC 6291728K->240K(8393600K), 0.0016680 secs]
[GC 8388080K->208K(8393600K), 0.0018730 secs]

-XX:NewSize=30g -mx31g -XX:SurvivorRatio=100 -verbosegc 32- NUMA.

[GC 30840864K->256K(31154304K), 0.0014270 secs]
[GC 30840832K->256K(31154304K), 0.0014730 secs]
[GC 30840832K->224K(31154304K), 0.0016500 secs]
[GC 30840800K->272K(31154304K), 0.0015740 secs]
[GC 30840848K->272K(31462336K), 0.0015280 secs]

-XX:NewSize=128g -mx130g -XX:SurvivorRatio=100 -verbosegc . . NUMA 64- . 2 .

[GC 131586048K->320K(132907264K), 0.0042360 secs]
[GC 131586368K->1376K(132907264K), 0.0058030 secs]
[GC 131587424K->1440K(132907264K), 0.0034110 secs]

20 Long .

, 128- Eden .: D


, eden GC. , .

+2

All Articles