为什么 Solaris 上的 Sun Java 占用 RSS 内存的两倍以上?
我的 Solaris 服务器出现问题。当我启动内存受限的 Sun Java 进程时,它会占用两倍以上的资源。
例如,我的服务器上有 64 Go 内存。 1 在 Linux 上,其他在 Solaris 上。我在所有服务器上运行相同的软件(仅java)。
服务器启动时会占用 400Mb 到 1.2Gb 的 RAM。我启动了我的 java 进程(通常每个 java 进程在 4 到 16go 之间),但我无法运行使用 Xmx 和 Xmx 值定义的超过 32 GB 的内存。我遇到了这种错误:
> /java -d64 -Xms8G -Xmx8G -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
正如我们在这里看到的,我有很多保留的内存,它是由java进程创建的:
> swap -s
total: 22303112k bytes allocated + 33845592k reserved = 56148704k used, 704828k available
一旦我一一杀死它们,我就恢复了我的保留空间并可以启动其他空间。但实际上我的记忆力根本用不上一半。
有人知道如何解决这个问题吗?
谢谢
I've got a problem on my Solaris servers. When I launch a Sun Java process with restricted memory it takes more than twice the ressources.
For example, I have 64 Go of memory on my servers. 1 is on Linux, the others are on Solaris. I ran the same softwares on all servers (only java).
When servers starts they took between 400Mb and 1,2Gb of RAM. I launch my java process (generally between 4 and 16go per java process) and I can't run more than 32 Gb defined with Xmx and Xmx values. I got this kind of errors :
> /java -d64 -Xms8G -Xmx8G -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
As we can see here, I got a lot of reserved memory and it's made by java process :
> swap -s
total: 22303112k bytes allocated + 33845592k reserved = 56148704k used, 704828k available
As soon as I kill them 1 by 1, I recover my reserved space and could launch others. But in fact I can't use more than a half my memory.
Anybody know how to resolve this problem ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题在于 Linux 过度提交内存分配,而 Solaris 则确保您分配的内容适合虚拟内存。
如果您认为这是 Linux 的优势,那么当 Linux OOM 杀手在最糟糕的阶段随机杀死您的关键任务应用程序时,您可能会重新考虑这一点。
要解决此问题,只需向 Solaris 添加更多交换空间即可。
I believe the issue is Linux over committing memory allocation while Solaris is make sure what you allocate fit in virtual memory.
If you think that's a Linux advantage, you might reconsider it when Linux OOM killer randomly kill your mission critical application at it worst stage.
To fix the issue, just add more swap space to Solaris.