Java应用程序使用系统中的最大可用内存 [英] Java application to use maximum available memory in the system

查看:640
本文介绍了Java应用程序使用系统中的最大可用内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有-Xmx和max-heap-size(jnlp)选项来设置Java应用程序可以使用的最大内存. 如果未指定这些选项,则允许应用程序在系统中仅使用少量的可用物理内存.
这就是人们使用-Xmx允许应用程序使用更多内存的原因.但这对我来说确实是一场噩梦,因为客户端计算机上可能会有不同的内存,甚至应该考虑使用OS.

There are -Xmx and max-heap-size (jnlp) options to set maximum memory java application can use.
If these options are not specified application is permitted to use only small amount of available phisical memory in the system.
That is the reason people play with -Xmx to allow application to use more memory. But this is really a nightmare as for me because there could be different amont of memory on client machine and even OS should be taken into consideration.

有什么方法可以让Java应用程序使用系统中的最大可用内存?

Is there any way to alow java application to use maximum available memory in the system?

谢谢.

推荐答案

-XX:DefaultMaxRAMFraction=1

bugs.sun.com
Sun的1.5 JVM
默认堆大小

bugs.sun.com
Sun's 1.5 JVM
Default Heap Size

不适用于网络启动.

这篇关于Java应用程序使用系统中的最大可用内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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