哪些参数代表JVM内存选项中的内容? [英] Which arguments stand for what in JVM memory options?

查看:250
本文介绍了哪些参数代表JVM内存选项中的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多JVM参数影响JVM的内存使用情况,如 -Xms,-Xmx,-Xns,-XX:MaxPermSize ...

There a lot of JVM arguments that affect the JVM's memory usage like -Xms, -Xmx, -Xns, -XX:MaxPermSize...


  • 他们做了什么?

  • 还有吗?

  • 其中当我得到什么错误时,我必须增加一个(例如 OutOfMemoryError StackOverflowError ...)?

  • What do they do?
  • Are there any more?
  • Which one do I have to increase when I get what error (e.g. OutOfMemoryError, StackOverflowError...)?

我找不到一个好的备忘单 - 让我们在这里创建一个。

I cannot find a good cheat sheet for them - let's create one here.

推荐答案

-Xms: 此选项设置初始和最小Java堆大小。

-Xms: this option sets the initial and minimum Java heap size.

-Xmx:
此选项设置最大Java堆大小。 Java堆(堆)是内存块的一部分,其中内存块被分配给对象并在垃圾回收期间释放。

-Xmx: This option sets the maximum Java heap size. The Java heap (the "heap") is the part of the memory where blocks of memory are allocated to objects and freed during garbage collection.

-XX:PermSize: -XX:MaxPermSize: 用于设置尺寸永久代。永久空间存储了VM使用的类,方法,内化字符串和类似对象,并且永远不会被释放(因此名称)。

-XX:PermSize: -XX:MaxPermSize: are used to set size for Permanent Generation. The permanent space is where are stored the class, methods, internalized strings, and similar objects used by the VM and never deallocated (hence the name).

-Xss: 设置线程堆栈大小。线程堆栈是为每个Java线程分配的内存区域,供内部使用。这是线程存储其本地执行状态的位置。

-Xss: sets the thread stack size. Thread stacks are memory areas allocated for each Java thread for their internal use. This is where the thread stores its local execution state.

-Xns: 集托儿所的大小。当使用分代垃圾收集模型时,JRockit JVM使用托儿所,也就是说,当动态垃圾收集器确定应该使用分代垃圾收集模型时或者静态分代并发垃圾收集器(-Xgc:gencon)已经使用时选择。您还可以在运行动态垃圾收集器(-XgcPrio)时使用-Xns设置静态托儿所大小。

-Xns: sets the nursery size. the JRockit JVM uses a nursery when the generational garbage collection model is used, that is, when the dynamic garbage collector has determined that the generational garbage collection model should be used or when the static generational concurrent garbage collector ( -Xgc : gencon) has been selected. You can also use -Xns to set a static nursery size when running a dynamic garbage collector (-XgcPrio).


  • 如果您得到 java.lang.OutOfMemoryError:Java堆空间 而不是更改 -Xmx 和 -Xms

如果你得到 java.lang.OutOfMemoryError:PermGen space 比尝试增加 - XX:MaxPermSize 值。

如果你得到 java.lang.StackOverflowError ,而不是尝试增加 -Xss 值。通过增加堆栈大小可能会有所帮助,但您也应该查看代码。

if you are getting java.lang.StackOverflowError than try increasing the -Xss value. It may be helpful by increasing the stack size but you should have a look at your code as well.

这篇关于哪些参数代表JVM内存选项中的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆