Where can I permanently set java heap size on Windows pc?

前端 未结 3 1182
余生分开走
余生分开走 2021-01-03 13:37

I recently downloaded the latest Java 1.6 JDK. I\'m using VisualVM which came with the SDK to test/monitor my webapp (using Tomcat server) on my local pc. I\'m running Windo

相关标签:
3条回答
  • 2021-01-03 14:18

    These parameters are passed to JVM via command line: -Xms and -Xmx For more information run java -X.

    0 讨论(0)
  • 2021-01-03 14:31

    You can use the JAVA_OPTS environment variable for dealing with java heap size. This variable can be added as a environment variable as well as you can define a configuration line in the startup.bat file.

    Add the following line in the startup.bat file.

    set JAVA_OPTS=-Xms512m -Xmx512m
    

    You can add this as environment variable as said.

    0 讨论(0)
  • 2021-01-03 14:33

    The best place to place these settings is in setenv.bat or setenv.sh in the bin folder. Take a look at a recent SO question on the same topic which has excellent answers.

    0 讨论(0)
提交回复
热议问题