Note that there are some explanatory texts on larger screens.

plurals
  1. POJava ParNew Collection moving objects to Old Generation
    primarykey
    data
    text
    <p>That's my VM arguments:</p> <pre><code>-XX:MaxPermSize=128m -XX:+UseParNewGC -XX:MaxNewSize=1G -XX:NewSize=1G -Xms13G -Xmx13G -XX:SurvivorRatio=128 -XX:MaxTenuringThreshold=0 -XX:+UseTLAB -XX:+UseConcMarkSweepGC -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:./gc.log -cp </code></pre> <p>I have also created memory leak:</p> <pre><code>{ String s = ""; for (int i = 0; i &lt; objectsCount; i++) s += "s" + s; }//Here all created objects should be garbage collected </code></pre> <p>So i have run that part of the code few times and i noticed that most of the objects are moved to Old Generation and only some are collected by small GC</p> <pre><code>832.135: [GC 832.135: [ParNew: 1032095K-&gt;0K(1040512K), 0.7309045 secs] 4832264K-&gt;4761739K(13623424K), 0.7309703 secs] [Times: user=2.37 sys=0.33, real=0.73 secs] 833.148: [GC 833.148: [ParNew: 826257K-&gt;0K(1040512K), 0.1510836 secs] 5587996K-&gt;5095138K(13623424K), 0.1511436 secs] [Times: user=0.33 sys=0.00, real=0.15 secs] 833.567: [GC 833.567: [ParNew: 742459K-&gt;0K(1040512K), 0.2067575 secs] 5837597K-&gt;5836296K(13623424K), 0.2068291 secs] [Times: user=0.75 sys=0.00, real=0.21 secs] 853.490: [GC 853.582: [ParNew: 993475K-&gt;0K(1040512K), 0.6963577 secs] 8100247K-&gt;7107608K(13623424K), 0.6968597 secs] [Times: user=1.61 sys=0.00, real=0.79 secs] 879.973: [GC 879.973: [ParNew: 1032433K-&gt;0K(1040512K), 10.6403908 secs] 8140042K-&gt;8061725K(13623424K), 10.6404844 secs] [Times: user=30.93 sys=0.34, real=10.64 secs] </code></pre> <p>I think reason is, too many objects are pasted to memory in the same time so its more convenient for garbage collector to move them from Young Generation or Old Generation.</p> <p>My question is, what should i change in my arguments, to make all of those objects be cleared by Small GC?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload