如何增加 JVM 内存?

2022-01-16 00:00:00 jvm java

我想知道是否可以根据我的应用程序增加 JVM 的内存.如果可以,如何增加 JVM 内存?我怎么知道JVM的大小?

I like to know can I increase the memory of the JVM depending on my application.If yes how can I increase the JVM memory? And how can I know the size of JVM?

推荐答案

启动JVM时,可以调整两个参数来满足你的内存需求:

When starting the JVM, two parameters can be adjusted to suit your memory needs :

-Xms<size>

指定初始 Java 堆大小和

specifies the initial Java heap size and

-Xmx<size>

最大 Java 堆大小.

the maximum Java heap size.

http://www.rgagnon.com/javadetails/java-0131.html

相关文章