Search code examples
mavenjvmheap-memoryforkpermgen

Will child JVM "inherit" max heap size and perm gen size when forked?


If I specify a given max heap size and perm gen size in an exported shell variable i.e. JAVA_OPTS or MAVEN_OPTS and the Maven build forks the JVM, will the child JVM "inherit" or attempt to access the same configuration as the parent JVM, when I run my build from the shell?


Solution

  • Nope, they won't inherit. This is a common problem with Maven plugins; they usually have a parameter (e.g. surefire's argLine) that lets you specify what JVM options you want.