Changing javac default initial heap size
Erik Joelsson
erik.joelsson at oracle.com
Wed Oct 11 10:21:47 UTC 2017
Hello,
I believe Wade is rather asking about the resulting javac binary that
the build produces. If that's the case, you need to edit
jdk/make/launcher/Launcher-jdk.compiler.gmk and add your desired flags
to the JAVA_ARGS argument to SetupBuildLauncher for javac. Example:
$(eval $(call SetupBuildLauncher, javac, \
MAIN_CLASS := com.sun.tools.javac.Main, \
JAVA_ARGS := --add-modules ALL-DEFAULT -Xms512m, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
(I have not tested this, but it should work)
/Erik
On 2017-10-11 01:44, David Holmes wrote:
> Hi Wade,
>
> On 11/10/2017 9:01 AM, Wade Hennessey wrote:
>> The default initial heap size in OpenJDK9 is 8m (-Xms8m), and I'd
>> like to
>> increase it, but I can't find how this is specified in the build
>> process.
>> It seams that most/all java binaries are based on the same main.c
>> program
>> that launches a specific binary such as javac by passing it parameters
>> through some sort of "Launcher" that specifes the command line options.
>> Unfortunately I don't understand how this is specified when javac is
>> linked. -wade
>
> javac compilations are mainly controlled through
>
> - make/common/SetupJavaCompilers.gmk
>
> but also see:
>
> - make/common/JavaCompilation.gmk
> - make/CompileJavaModules.gmk
>
> You can either adjust the flags you pass into the calls (from various
> makefiles) defined in SetupJavaCompilers or you can edit the FLAGS
> definitions in there directly e.g. to add -J-Xms16m
>
> Also look at the definition for JAVA_TOOL_FLAGS_SMALL.
>
> PS. The above are for new JDK 10 repo layout. For 9 it is probably in
> jdk/make.
>
> HTH
>
> David
>
More information about the build-dev
mailing list