之前一直是在本地tomcat服务器上运行这个项目,也都没事。这两天把这个项目发布到公司服务器上,结果一加载就崩溃了。根本就加载不了,连之前的项目都跑不了了。[WARN ] 2012-10-09 18:24:51,011 method:net.sf.ehcache.config.Configurator.configure(Configurator.java:126)
No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/BBS/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
[INFO ] 2012-10-09 18:24:52,027 method:org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:82)
Not binding factory to JNDI, no JNDI name configured
Exception in thread "TP-Processor7" java.lang.OutOfMemoryError: PermGen space
Exception in thread "JmDNS(dell-young.local.).Timer" java.lang.OutOfMemoryError: PermGen space
java.lang.reflect.InvocationTargetException看起来是内存溢出的问题。但是在我本地跑起来都没有任何问题,一发布到公司服务器上就崩溃了。求大牛指点迷津。谢谢。
No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/BBS/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
[INFO ] 2012-10-09 18:24:52,027 method:org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:82)
Not binding factory to JNDI, no JNDI name configured
Exception in thread "TP-Processor7" java.lang.OutOfMemoryError: PermGen space
Exception in thread "JmDNS(dell-young.local.).Timer" java.lang.OutOfMemoryError: PermGen space
java.lang.reflect.InvocationTargetException看起来是内存溢出的问题。但是在我本地跑起来都没有任何问题,一发布到公司服务器上就崩溃了。求大牛指点迷津。谢谢。
如:
-XX:MaxPermSize=64m
那要修改一下MaxPermSize的值另外这里又提示了:No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath看下ehcache.xml文件是不是没有,还是没有编译进去.
参考下下面的这个文章
http://passover.blog.51cto.com/2431658/732629tomcat默认可以使用的内存为128MB,在较大型的应用项目中,这点内存是不够的,需要调大。
Unix下,在文件{tomcat_home}/bin/catalina.sh的前面,增加如下设置:
JAVA_OPTS='-Xms【初始化内存大小】 -Xmx【可以使用的最大内存】'
需要把这个两个参数值调大。例如:
JAVA_OPTS='-Xms256m -Xmx512m'
表示初始化内存为256MB,可以使用的最大内存为512MB
在tomcat配置文件server.xml中的<Connector />配置中,和连接数相关的参数有:
minProcessors:最小空闲连接线程数,用于提高系统处理性能,默认值为10
maxProcessors:最大连接线程数,即:并发处理的最大请求数,默认值为75
acceptCount:允许的最大连接数,应大于等于maxProcessors,默认值为100
enableLookups:是否反查域名,取值为:true或false。为了提高处理能力,应设置为false
connectionTimeout:网络连接超时,单位:毫秒。设置为0表示永不超时,这样设置有隐患的。通常可设置为30000毫秒。
其中和最大连接数相关的参数为maxProcessors和acceptCount。如果要加大并发连接数,应同时加大这两个参数。
web server允许的最大连接数还受制于操作系统的内核参数设置,通常Windows是2000个左右,Linux是1000个左右。tomcat5中的配置示例:
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
对于其他端口的侦听配置,以此类推。