JVM large heap size parameter does not work, but initiates it through C ++

I am creating a JVM instance through C ++. I pass a couple parameters of the virtual machine when creating the instances. But at least one of the parameters for the maximum heap size does not show any difference. The maximum heap size always shows 65,536 KB, which parameter do I provide for it.

The code is shown below.

jvm=NULL; env=NULL; long result; char *pathname=(char*)malloc(1024); strcpy(pathname,"-Djava.class.path="); strcat(pathname,"/*class path*/"); vm_args.version= 0x00010006; vm_args.ignoreUnrecognized=JNI_TRUE; options[0].optionString=pathname; options[1].optionString="-Xms512M"; options[2].optionString="-Xmx1024M"; vm_args.options=options; vm_args.nOptions=3; 

Any suggestion. Thanks in advance.

+4
source share
1 answer

Not sure if this is important, but in my code I use the lowercase "m" at the end:

-Xmx1024m

instead

-Xmx1024M

what is the most obvious difference between your code and what we use ...

0
source

All Articles