首先说一下环境:
centos6.2
业务环境:kdweibo
情况说明一下:
为了适应公司业务发展需要,公司新购买了一批新机器,作为kdweibo的新环境,安装了比较新的操作系统:通统:centos6.2
一开始硬件(联想R68 G7)主板坏了,更换后再进行各种测试。
测试前是用root用户启动业务,没有什么问题。但是后来在用非root用户启动时出现种问题。java报如下错误:
There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create GC thread. Out of system resources.
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (gcTaskThread.cpp:46), pid=50128, tid=140649625663232
同时运行java -version也报错
执行一个ls也会报资源暂时不足
害得我又是查看系统的/etc/security/limit.conf 又是搞/etc/sysctl.conf 然后换JDK版本等等,搞得精疲力尽,到处找相关的资料!
搞了几天没有搞定,今天再接着进行这方面的研究,在以前的生产环境:centos5.5下可以正常使用的系统参数时突然发现:新系统的max user processes 只有1024 而旧系统默认为278528
你M呀,问题是出在这里了,再在/etc/security/下一看。centos6多出来一个limits.d目录,下面有个文件: 90-nproc.config
此文件内容:
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 1024
这里限制了1024呀,果断注释。
再运行业务程序,问题解决!汗一下,centos6加这个搞什么呢,没有搞清楚!
阅读(12165) | 评论(0) | 转发(0) |