如何调整JVM的内存大小???

landii 2000-09-12 01:41:00
...全文
372 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
skyyoung 2000-09-12
  • 打赏
  • 举报
回复
Set the memory available to the JVM
By default, the JVM will use up to 16Mb of RAM. If your program allocates a lot of memory, you may need to increase this value to give more room to the garbage collector.
When starting the JVM, two parameters can be adjusted to suit your memory needs :

-mx n Sets the maximum size of the memory allocation pool where n is in bytes, appending "m" to n will specified the number in megabytes, for example to set the maximum at 20Mb : java -mx 20m myApp




. -ms n Sets the startup size of the memory allocation pool, where n is in bytes, appending "m" to n will specified the number in megabytes. The default is 1Mb.
With JDK1.2, that syntax have changed, no space between ms/mx and the value : java -mx20m myApp


p9 2000-09-12
  • 打赏
  • 举报
回复
java -mx12345678 其中 12345678 为JVM的内存数,单位字节。

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧