1. <legend id='1HIkx'><style id='1HIkx'><dir id='1HIkx'><q id='1HIkx'></q></dir></style></legend>

        <tfoot id='1HIkx'></tfoot>

          <bdo id='1HIkx'></bdo><ul id='1HIkx'></ul>
        <i id='1HIkx'><tr id='1HIkx'><dt id='1HIkx'><q id='1HIkx'><span id='1HIkx'><b id='1HIkx'><form id='1HIkx'><ins id='1HIkx'></ins><ul id='1HIkx'></ul><sub id='1HIkx'></sub></form><legend id='1HIkx'></legend><bdo id='1HIkx'><pre id='1HIkx'><center id='1HIkx'></center></pre></bdo></b><th id='1HIkx'></th></span></q></dt></tr></i><div id='1HIkx'><tfoot id='1HIkx'></tfoot><dl id='1HIkx'><fieldset id='1HIkx'></fieldset></dl></div>

        <small id='1HIkx'></small><noframes id='1HIkx'>

      2. 如何通过环境变量设置 Java 的最小和最大堆大小?

        How do I set Java#39;s min and max heap size through environment variables?(如何通过环境变量设置 Java 的最小和最大堆大小?)

      3. <legend id='yj4s2'><style id='yj4s2'><dir id='yj4s2'><q id='yj4s2'></q></dir></style></legend>
        <i id='yj4s2'><tr id='yj4s2'><dt id='yj4s2'><q id='yj4s2'><span id='yj4s2'><b id='yj4s2'><form id='yj4s2'><ins id='yj4s2'></ins><ul id='yj4s2'></ul><sub id='yj4s2'></sub></form><legend id='yj4s2'></legend><bdo id='yj4s2'><pre id='yj4s2'><center id='yj4s2'></center></pre></bdo></b><th id='yj4s2'></th></span></q></dt></tr></i><div id='yj4s2'><tfoot id='yj4s2'></tfoot><dl id='yj4s2'><fieldset id='yj4s2'></fieldset></dl></div>
        1. <small id='yj4s2'></small><noframes id='yj4s2'>

                <tbody id='yj4s2'></tbody>
              <tfoot id='yj4s2'></tfoot>
                • <bdo id='yj4s2'></bdo><ul id='yj4s2'></ul>
                  本文介绍了如何通过环境变量设置 Java 的最小和最大堆大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何通过环境变量设置 Java 的最小和最大堆大小?

                  How do I set Java's min and max heap size through environment variables?

                  我知道在启动 java 时可以设置堆大小,但我想通过我的服务器上的环境变量进行调整.

                  I know that the heap sizes can be set when launching java, but I would like to have this adjusted through environment variables on my server.

                  推荐答案

                  不能直接使用环境变量.您需要使用传递给 java 命令的一组非标准"选项.运行:java -X 了解详情.您正在寻找的选项是 -Xmx 和 -Xms(这是初始"堆大小,因此可能是您正在寻找的.)

                  You can't do it using environment variables directly. You need to use the set of "non standard" options that are passed to the java command. Run: java -X for details. The options you're looking for are -Xmx and -Xms (this is "initial" heap size, so probably what you're looking for.)

                  某些产品(如 Ant 或 Tomcat)可能带有用于查找 JAVA_OPTS 环境变量的批处理脚本,但它不是 Java 运行时的一部分.如果您使用其中一种产品,您可以设置如下变量:

                  Some products like Ant or Tomcat might come with a batch script that looks for the JAVA_OPTS environment variable, but it's not part of the Java runtime. If you are using one of those products, you may be able to set the variable like:

                  set JAVA_OPTS="-Xms128m -Xmx256m"  
                  

                  您也可以使用自己的命令行来采用这种方法,例如:

                  You can also take this approach with your own command line like:

                  set JAVA_OPTS="-Xms128m -Xmx256m"  
                  java ${JAVA_OPTS} MyClass
                  

                  这篇关于如何通过环境变量设置 Java 的最小和最大堆大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Maven JAVA_HOME environment variable is not defined correctly, but it is(Maven JAVA_HOME 环境变量未正确定义,但它是)
                  Java System Environment Variable(Java 系统环境变量)
                  Java -classpath option(Java -classpath 选项)
                  Read environment variable in SpringBoot(在 SpringBoot 中读取环境变量)
                  Tomcat 8 - context.xml use Environment Variable in Datasource(Tomcat 8 - context.xml 在数据源中使用环境变量)
                  Issue with JAVA_HOME(JAVA_HOME 的问题)

                      <i id='ysQcJ'><tr id='ysQcJ'><dt id='ysQcJ'><q id='ysQcJ'><span id='ysQcJ'><b id='ysQcJ'><form id='ysQcJ'><ins id='ysQcJ'></ins><ul id='ysQcJ'></ul><sub id='ysQcJ'></sub></form><legend id='ysQcJ'></legend><bdo id='ysQcJ'><pre id='ysQcJ'><center id='ysQcJ'></center></pre></bdo></b><th id='ysQcJ'></th></span></q></dt></tr></i><div id='ysQcJ'><tfoot id='ysQcJ'></tfoot><dl id='ysQcJ'><fieldset id='ysQcJ'></fieldset></dl></div>
                      <tfoot id='ysQcJ'></tfoot>

                      1. <legend id='ysQcJ'><style id='ysQcJ'><dir id='ysQcJ'><q id='ysQcJ'></q></dir></style></legend>
                          <tbody id='ysQcJ'></tbody>

                        <small id='ysQcJ'></small><noframes id='ysQcJ'>

                          <bdo id='ysQcJ'></bdo><ul id='ysQcJ'></ul>