Error creating bean with name 'memcachedClient'...java.lang.OutOfMemoryError
1,Tomcat启动报错例如以下:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'memcachedClient' defined in file [/usr/local/apache-tomcat-6.0.37_6500/webapps/trade_service/WEB-INF/classes/META-INF/spring/springContext_memcached.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public net.rubyeye.xmemcached.MemcachedClient net.rubyeye.xmemcached.XMemcachedClientBuilder.build() throws java.io.IOException] threw exception; nested exception is java.lang.OutOfMemoryError
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod (ConstructorResolver.java:581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod (AbstractAutowireCapableBeanFactory.java:1015)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference (BeanDefinitionValueResolver.java:322)
... 44 more
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public net.rubyeye.xmemcached.MemcachedClient net.rubyeye.xmemcached.XMemcachedClientBuilder.build() throws java.io.IOException] threw exception; nested exception is java.lang.OutOfMemoryError
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate (SimpleInstantiationStrategy.java:169)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod (ConstructorResolver.java:570)
... 53 more
Caused by: java.lang.OutOfMemoryError
,
2,看到创建memcache clent报错,立即去memcacheserver查看一下,memcache正常执行,内存也足够剩余。
[root@localhost ~]# tail -f /tmp/memcache_error.log
<287 0x00 0x00 0x00 0x00
<287 0x00 0x00 0x00 0x00
<287 0x00 0x00 0x00 0x00
>287 Writing bin response:
>287 0x81 0x0b 0x00 0x00
>287 0x00 0x00 0x00 0x00
>287 0x00 0x00 0x00 0x06
>287 0x00 0x00 0x00 0x00
>287 0x00 0x00 0x00 0x00
>287 0x00 0x00 0x00 0x00
...
[root@localhost ~]# free -m
total used free shared buffers cached
Mem: 5938 3368 2570 0 195 296
-/+ buffers/cache: 2876 3061
Swap: 7935 0 7935
[root@localhost ~]#
问题在哪里?再看看日志里面有误error或者warning信息:
[root@localhost ~]# cat /tmp/memcache_error.log |grep warning
[root@localhost ~]# cat /tmp/memcache_error.log |grep error
[root@localhost ~]#
一点错误信息也没有,推断问题不是出在memcache这一块。
3,去check tomcatserver
[root@localhost logs]# free -m
total used free shared buffers cached
Mem: 18022 16943 1078 0 104 675
-/+ buffers/cache: 16162 1859
Swap: 20031 8012 12019
[root@localhost logs]#
仅仅剩余1个G的内存,去改动一下tomcat的内存配置:
[root@localhost bin]# vim catalina.sh
#JAVA_OPTS="-Xms2048m -Xmx2048m -Xss1024K -XX:PermSize=256m -XX:MaxPermSize=768m"
# add by wangqi on 20140614
JAVA_OPTS="-Xms512m -Xmx512m -Xss128K -XX:PermSize=64m -XX:MaxPermSize=256m"
再重新启动tomcat,看到还是报一样的错误。
4,回到应用本身去查问题
跟开发者一起排查,看到是trade_service启动了过多的多余的事务,把tomcat的内存耗光了,所以关闭掉多余的事务,再启动tomcat,就不会再报错。
感慨:就跟大部分web应用卡,页面登录不上去,对应过慢非常多是出在效率低下的sql上面,tomcat启动不起来,内存溢出大部分也是在java代码上面,大家须要写代码或者sql须要慎重,且写且慎重。
Error creating bean with name 'memcachedClient'...java.lang.OutOfMemoryError的更多相关文章
- Error creating bean with name 'menuController': Injection of autowired dependency……
出现了一大串错误 Error creating bean with name 'userController': Injection of autowired dependencies failed. ...
- Error creating bean with name 'com.you.user.dao.StudentDaoTest': Injection of autowired dependencies
1.错误叙述性说明 七月 13, 2014 6:37:41 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadB ...
- [bigdata] 启动CM出现 “JDBC Driver class not found: com.mysql.jdbc.Driver” 以及“Error creating bean with name 'serverLogFetcherImpl'”问题的解决方法
问题:“JDBC Driver class not found: com.mysql.jdbc.Driver” 通过以下命令启动cm [root@hadoop1 ~]# /etc/init.d/cl ...
- Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer'
@Configuration public class HttpSessionConfig { @Bean public static ConfigureRedisAction configureRe ...
- 出错:Error creating bean with name 'studentServiceImpl': Unsatisfied dependency expressed through field 'studentMapper';
详细错误: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with nam ...
- ssh整合报错严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxx'
错误描述:eclipse整合ssh的时候 报不能创建名字为xxx的对象 信息: Destroying singletons in org.springframework.beans.factory.s ...
- Error creating bean with name 'adminUserController': Injection of autowired dependencies failed;
spring 个坑爹地,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto
控制台: 2016-4-1 16:32:06 org.hibernate.annotations.common.Version <clinit> 信息: Hibernate Commons ...
- Error creating bean with name 'us' defined in class path resource [com/liuyang/test/DI/beans2.xml]: Cannot resolve reference to bean 'daoa' while setting bean property 'daoa'; nested exception is org.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'us' defined ...
随机推荐
- SQL函数简述
数字函数ABS 取绝对值 POWER 乘方 LN 10为底数取幂SQRT 平方根 EXP e的n次乘方 LOG(m,n) m为底数n取幂数学运算函数:ACOS ATAN ATAN2 COS COSH ...
- AndroidAnnotations框架配置
如今Android Studio的普及,Android开发基本要舍弃Eclipse了,最近使用AndroidAnnotations 注解框架的时候,找了些资料慢慢整出来了,在这给大家简单分享一下: 首 ...
- wcf wpf
转 http://blog.csdn.net/thunder09/article/details/5792157 WPF就是所谓下一代Windows界面层技术,我觉得还有满有前途的.不过Vista发布 ...
- silverlight 双坐标轴
public void CreateLine(Grid oGrid, string sTitle, string sTableName, bool ifGetSig, string sYUint, s ...
- AngularJS的$http服务的应用
$http有很多参数和调用方法,本文只记录比较常用的应用及参数. $http 服务:只是简单封装了浏览器原生的XMLHttpRequest对象,接收一个参数,这个参数是一个对象,包含了用来生成HTTP ...
- Json部分知识(前台显示格式、Json-lib日期处理)
1,Json格式用于datagrid数据显示 easyui前台显示数据可以使用JSONObject,也可以使用JSONArray.但是如果需要在datagrid表格中进行数据显示,只能使用JSONOb ...
- 翻译一篇SpiderMonkey GC的文章
前言 这篇文章包含了对SpiderMonkey中Rooted<T>, Handle<T>的解释. 翻译自 https://developer.mozilla.org/en-US ...
- sqlite的事务
好久没用数据库,知识都忘了,之前用sqlite 逐行insert数据,发现这性能实在是太坑,10w条数据,插入大约花了100来分钟. 后来发现还有事务这么一个东西,可以大幅度降低对io的操作,测试插入 ...
- 获取当前PHP运行环境是否cli模式
需要用到系统函数php_sapi_name() 或者 系统常量 PHP_SAPI,返回 cli 或 cli_server /* 判断当前的运行环境是否是cli模式 */ function is_cli ...
- python中 and 和 or 运算的核心思想 ——— 短路逻辑
python中 and 和 or 运算的核心思想 --- 短路逻辑 1. 包含一个逻辑运算符 首先从基本的概念着手,python中哪些对象会被当成 False 呢?而哪些又是 True 呢? 在Pyt ...