java - JDK7 JVM different from JDK8 -


when run code

public static void main(string[] args) {     byte[] b = null;     for(int i=0;i<10;i++)         b = new byte[1024 * 1024]; } 

with jvm options -xmx20m -xms20m -xmn1m -xx:+printgcdetails in jdk7,console print enter image description here. when run jvm options in jdk8,it print

error occurred during initialization of vm gc triggered before vm initialization completed. try increasing newsize, current value 1536k. java hotspot(tm) 64-bit server vm warning: newsize (1536k) greater maxnewsize (1024k). new max generation size of 1536k used. 

why?

the error message contains reason.

gc triggered before vm initialization completed.

it unrelated code since vm initialization happens before main runs.


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -