java - 如何提高Jboss 使用的内存量?

标签 java linux jboss redhat

我有一个在 jboss-5.0.0.GA 上运行的 Java EE 应用程序。该应用程序使用 BIRT 报告工具生成多个报告。

服务器有 4 个 2.4 Ghz 内核和 8 Gb 内存。

启动脚本正在使用下一个选项:

 -Xms2g -Xmx2g -XX:MaxPermSize=512m

此配置下应用程序已达到一定程度的稳定性,前段时间我遇到了很多崩溃,因为内存已满。

现在,应用程序没有崩溃,但内存总是被完全使用。 top命令示例:

Mem:   7927100k total,  7874824k used,    52276k free

java进程显示使用2.6g,这是该服务器上运行的唯一应用。

我该怎么做才能确保有足够的可用内存?

我该怎么做才能找到内存泄漏?

还有什么建议吗?

TIA


基于 mezzie 的回答:

If you are using linux, what the kernel does with the memory is different with how windows work. In linux, it will try to use up all the memory. After it uses everything, it will then recycle the memory for further use. This is not a memory leak. We also have jboss tomcat on our linux server and we did research on this issue a while back.

我找到了更多关于这个的信息,

https://serverfault.com/questions/9442/why-does-red-hat-linux-report-less-free-memory-on-the-system-than-is-actually-ava

http://lwn.net/Articles/329458/

好吧,缓存了一半内存:

             total       used       free     shared    buffers     cached
Mem:          7741       7690         50          0        143       4469

最佳答案

如果您使用的是 Linux,内核对内存的处理方式与 Windows 的工作方式不同。在 linux 中,它会尝试用完所有内存。使用完所有内容后,它将回收内存以供进一步使用。这不是内存泄漏。我们的 linux 服务器上也有 jboss tomcat,不久前我们研究了这个问题。

关于java - 如何提高Jboss 使用的内存量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4210352/

相关文章:

linux - Linux中什么不是文件

java - 在 JBoss 上部署问题

java - 无法使用 XPATH 设置 header

java - 应用程序设计MVC模式

Java:反编译后的奇怪结果

linux - 在 find 和 ls 中使用通配符

linux - 调整大小时的 SDL 鼠标范围

tomcat - 如何获取tomcat ApplicationContextFacade的工作目录

java - 按钮文本不断重置

java - 如何从底部 fragment 获取数据到主要 Activity ?