SuSE Linux的最大Java堆空间是多少 [英] What is the Maximum Java Heap Space for SuSE Linux

查看:145
本文介绍了SuSE Linux的最大Java堆空间是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与 Java拒绝启动-无法为对象堆预留足够的空间,应该足够容易找出.然而;我的搜索没有产生任何有用的信息.

This question is related to Java Refuses To Start - Could Not Resrve Enough Space for Object Heap and should be easy enough to figure out. However; my searches haven't yielded anything useful.

基本上,我们在具有相同硬件的不同机器上具有2个32位OS(RedHat和SuSE).两者都使用相同的JVM,并且都执行相同的命令行. RedHat可以正常工作,但是SuSE报告内存不足.

Essentially we have 2 32 bit OS's (RedHat & SuSE) on different machines with the same hardware. Both use the same JVM both executing the same command line. RedHat works perfectly fine but SuSE reports there isn't enough Memory.

我们只需要知道这是否是我们正在使用的SuSE版本的限制,还是其他原因.

We just need to know if this is a limitation of the version of SuSE we're using or if it's something else.

'cat/proc/version'给我们:

'cat /proc/version' gives us:

Linux version 2.6.5-7.244-bigsmp (geeko@buildhost) (gcc version 3.3.3 (SuSE Linux)) #1 SMP Mon Dec 12 18:32:25 UTC 2005

'uname -a'为我们提供了两种机器类型的信息:

'uname -a' gives us the following on BOTH types of machines:

UTC 2005 i686 i686 i386 GNU/Linux

推荐答案

JVM内存限制与最大的可用连续可用块有关,而不与可用内存量有关.限制从大约1.4 GB到超过2.0 GB的一点不等,具体取决于您的操作系统将各种内容放置在内存中的位置.我不知道Redhat或Suse将内容加载到内存中的详细信息,但可能是suse将某些库映射到RAM中间的地址,Redhat可能在末尾将其映射(推测).

The JVM memory limit is related the largest free contiguous block available, not the amount of free memory. The limit varies from about 1.4 GB to a bit over 2.0 GB, and depends on where your operating system puts various things in memory. I don't know the particulars of where Redhat or Suse load stuff into memory, but it could be that suse is mapping some library to an address in the middle of RAM, where Redhat might map it at the end (speculating).

请记住,您在Java中的实际内存使用量比为Xmx指定的实际使用量还高.其他内存设置也会影响堆的大小(例如permgen).因此,也可能是Suse上的烫发空间具有比Redhat上更大的默认空间.

And remember that your actual memory usage in java is more than what you specify for Xmx. The other memory settings also affect the size of your heap (like permgen). So it could also be that the perm space on Suse has a larget default than on Redhat.

此外,根据应用程序的内存分配配置文件,您可能会以较小的堆大小和不同的垃圾收集选项而脱身.这里有一些详细信息( http://java.sun.com/performance/reference/whitepapers/tuning.html )和其他地方.例如,如果您分配了很多小的临时块,那么您将需要不同的GC设置,而不是拥有很多长寿命的对象.

Also, depending on the memory allocation profile of your application, you might get away with a smaller heap size and different garbage collecting options. There are some details here (http://java.sun.com/performance/reference/whitepapers/tuning.html) and other places. For example, if you allocate a lot of small, temporary blocks, you'll want different GC settings than if you have a lot of bit, long-lived objects.

关于链接的问题,为什么不仅仅使用Redhat?那可能是一个简单的解决方案,但我保证它比深度研究Java调整和OS内存管理的奥秘世界更快地解决您的问题:P

Regarding the linked question, why not just use Redhat? That might be a simplistic solution, but I guarantee it's going to fix your problem faster than deeply delving into the arcane world of java tuning and OS memory management :P

这篇关于SuSE Linux的最大Java堆空间是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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