什么会导致java进程大大超过Xmx或Xss限制? [英] What would cause a java process to greatly exceed the Xmx or Xss limit?

查看:1242
本文介绍了什么会导致java进程大大超过Xmx或Xss限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在3个不同的服务器上运行了7个不同的java守护进程(全部7个)。 java命令行有-Xmx2048m和-Xss1024k。在这3台服务器上,所有21个进程在顶部和顶部都显示不到2.5 GB的VIRT大小。根据守护进程,RES的大小从300到1.9 GB不等。

I have 7 different java daemons that I run (all 7) on 3 different servers. The java command line has -Xmx2048m and -Xss1024k. On these 3 servers, all 21 processes show just under 2.5 GB for VIRT size in top and atop. RES size varies from 300 to 1.9 GB according to which daemon it is.

这就是它应该的全部。

输入新服务器。更快的CPU,更多的RAM(16 GB而不是8 GB),稍微更新的java(旧服务器上为1.6.0_10-b33,新服务器上为1.6.0_31-b04)。两个系统(和JVM)都是64位。

Enter the new server. Faster CPU, more RAM (16 GB instead of 8 GB), slightly newer java (1.6.0_10-b33 on the old servers, 1.6.0_31-b04 on the new server). Both systems (and JVMs) are 64bit.

将2个守护进程移动到新服务器。在新服务器上,给定相同的任务,守护进程都消耗了更多的CPU(大约是核心价值)并且做得少。 (从旧系统上的5110处理器转移到新系统上的5620s)。

Moved 2 of the daemons to the new server. On the new server, given the same task, the daemons are both consuming vastly more CPU (about a core's worth) and getting Less done. (Moved from 5110 processors on the old systems to 5620s on the new one).

几乎是CPU使用的全部核心(GC线程??)和报告5 GB VIRT和2 GB RES用于一个守护进程,10.5 GB VIRT和2 GB RES用于另一个守护进程。

Pretty much a full extra core of CPU usage (GC thread??) and reporting 5 GB VIRT and 2 GB RES for one daemon and 10.5 GB VIRT and 2 GB RES for the other daemon.

任何想法会导致java忽略(或似乎忽略)如果是这种情况)内存限制?

Any ideas what would cause java to ignore (or appear to ignore if that is the case) the memory limits?

推荐答案

原来这是一个glibc问题。

Turns out this is a glibc problem.

我的简短回答是:

export MALLOC_ARENA_MAX = 1

export MALLOC_ARENA_MAX=1

这减少了过程占地面积(顶部的VIRT),降低了5倍。回到CentOS 5中的水平。

This decreased process footprint (VIRT in top) by as much as 5x. Back to the levels seen in CentOS 5.

最新版本的glibc有一个新功能每线程内存池:

Recent versions of glibc have a new feature "per-thread memory pools":

http://www.centos.org/docs/5/html /5.4/Technical_Notes/glibc.html

1.71.1日志部分中的最后一项讨论它(并指的是非公开的bug .. ..)

The last item in the 1.71.1 log section discusses it (and refers to a non-public bug....)

这篇关于什么会导致java进程大大超过Xmx或Xss限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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