有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (5) 个答案

  1. # 1 楼答案

    应用程序的最大堆使用量为1024MB

  2. # 2 楼答案

    -Xmx设置最大堆大小

  3. # 3 楼答案

    C:\java -X
    
        -Xmixed           mixed mode execution (default)
        -Xint             interpreted mode execution only
        -Xbootclasspath:<directories and zip/jar files separated by ;>
                          set search path for bootstrap classes and resources
        -Xbootclasspath/a:<directories and zip/jar files separated by ;>
                          append to end of bootstrap class path
        -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                          prepend in front of bootstrap class path
        -Xnoclassgc       disable class garbage collection
        -Xincgc           enable incremental garbage collection
        -Xloggc:<file>    log GC status to a file with time stamps
        -Xbatch           disable background compilation
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap size
        -Xss<size>        set java thread stack size
        -Xprof            output cpu profiling data
        -Xfuture          enable strictest checks, anticipating future default
        -Xrs              reduce use of OS signals by Java/VM (see documentation)
        -Xcheck:jni       perform additional checks for JNI functions
        -Xshare:off       do not attempt to use shared class data
        -Xshare:auto      use shared class data if possible (default)
        -Xshare:on        require using shared class data, otherwise fail.
    
    The -X options are non-standard and subject to change without notice.
    
  4. # 4 楼答案

    看这里:Java Tool Doc,上面写着

    -Xmxn
    Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. The upper limit for this value will be approximately 4000m on Solaris 7 and Solaris 8 SPARC platforms and 2000m on Solaris 2.6 and x86 platforms, minus overhead amounts. Examples:

               -Xmx83886080
               -Xmx81920k
               -Xmx80m
    

    因此,简单地说,您将Java堆内存设置为可用内存的最大1024MB,而不是更多

    注意,在-Xmx和1024m之间没有空间

    不管你用大写还是小写。例如:“-Xmx10G”和“-Xmx10G”做完全相同的事情

  5. # 5 楼答案

    -Xmx选项更改VM的最大堆空间。java-Xmx1024m意味着虚拟机最多可以分配1024MB的内存。用外行术语来说,这意味着应用程序最多可以使用1024MB的内存