Jdon causes 99% of CPU and Tomcat dies -- banq replies

Jiedao jdon 2021-05-04 14:52:05
jdon causes cpu tomcat dies


problem : Recently discovered the customer's machine tomcat Process cpu Often in 99% Basically leading to application death

analysis : Through analysis , Found a lot of threads stuck , Look at the stack information as follows :

http-80-1 RUNNABLE java.lang.Thread

java.util.HashMap.get(Unknown Source)

com.jdon.container.pico.JdonPicoContainer.getInstance(JdonPicoContainer.java:327)

com.jdon.container.pico.JdonPicoContainer.getComponentInstance(JdonPicoContainer.java:309)

org.picocontainer.defaults.BasicComponentParameter.resolveInstance(BasicComponentParameter.java:77)

org.picocontainer.defaults.ComponentParameter.resolveInstance(ComponentParameter.java:117)

org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:193)

org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:148)

org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:56)

org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:184)

com.jdon.container.pico.PicoContainerWrapper.getComponentNewInstance(PicoContainerWrapper.java:197)

com.jdon.bussinessproxy.target.POJOObjectFactory.create(POJOObjectFactory.java:45)

com.jdon.bussinessproxy.target.DefaultTargetServiceFactory.create(DefaultTargetServiceFactory.java:59)

com.jdon.aop.reflection.MethodInvokerUtil.createTargetObject(MethodInvokerUtil.java:102)

com.jdon.aop.reflection.ProxyMethodInvocation.methodInvoke(ProxyMethodInvocation.java:97)

com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:76)

com.jdon.aop.interceptor.SessionContextInterceptor.invoke(SessionContextInterceptor.java:76)

com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)

com.jdon.aop.interceptor.StatefulInterceptor.invoke(StatefulInterceptor.java:82)

com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)

com.jdon.aop.interceptor.PoolInterceptor.invoke(PoolInterceptor.java:91)

com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)

com.jdon.aop.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:69)

com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)

com.jdon.aop.AopClient.invoke(AopClient.java:95)

com.jdon.bussinessproxy.dyncproxy.DynamicProxyWeaving.invoke(DynamicProxyWeaving.java:62)

$Proxy11.getKh_khddById(Unknown Source)

cn.vetech.framework.pszx.model.Kh_khdd_jcqp_tosave_action.checkB2BFKF(Kh_khdd_jcqp_tosave_action.java:943)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)

org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)

javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

cn.vetech.framework.asms.AgentFilter.doFilter(AgentFilter.java:54)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

com.jdon.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)

org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)

org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)

java.lang.Thread.run(Unknown Source)

This thread is basically stuck , And then more and more , Thread is stuck in java.util.HashMap.get(Unknown Source)

, And then I look at com.jdon.container.pico.JdonPicoContainer.getInstance(JdonPicoContainer.java:327)

This source code found that there is a special cache pojo An instance object of this configuration hashmap, The code is as follows :

public Object getInstance(ComponentAdapter componentAdapter)

{

Object componentKey = componentAdapter.getComponentKey();

Object instance = this.componentKeyToInstanceCache.get(componentKey);

if ((instance == null) &&

(componentAdapter != null)) {

instance = getTrueInstance(componentAdapter);

if (instance != null) {

this.componentKeyToInstanceCache.put(componentKey, instance);

}

}

return instance;

}

This code contains Object instance = this.componentKeyToInstanceCache.get(componentKey); Is defined as :

public class JdonPicoContainer

implements MutablePicoContainer, Serializable

{

public static final String module = JdonPicoContainer.class.getName();

private Map componentKeyToAdapterCache = new HashMap();

private Map componentKeyToInstanceCache = new HashMap();

..............

componentKeyToInstanceCache This one holds my definition of service and dao,jdon The framework is in me getting a service perhaps dao It's time to judge in this componentKeyToInstanceCache There are no examples in it , If not, instantiate an object and cache it to this map in , The next time I use this object again, I take it directly from the cache , So the problem is this componentKeyToInstanceCache Not a thread synchronized object , because JdonPicoContainer It's a single example .componentKeyToInstanceCache This object is equivalent to a global . Therefore, if the application of multithreading concurrency , There are bound to be problems in this place . And I'm going crazy to find this problem . Then I download the latest jdon Framework discovery of , This class has been modified to private Map componentKeyToInstanceCache = new ConcurrentHashMap(), Since the adjustment has been made, why didn't it be explained and told on the website . It's a huge problem for our users .

I may be wrong in my analysis , I hope the author will reply

[ The quilt mianwo602 On 2012-06-01 13:47 A modified ]

版权声明
本文为[Jiedao jdon]所创,转载请带上原文链接,感谢
https://javamana.com/2021/05/20210504144409625n.html

  1. Help, Java how to get all the current processes of the system
  2. Has anyone ever used JMeter or written tests in httpUnit????
  3. Living in a mountain village in late spring
  4. Partridge day, spring of HKUST
  5. JavaScript异步编程4——Promise错误处理
  6. 海康摄像SDK开发笔记(一):海康威视网络摄像头SDK介绍与模块功能
  7. JavaScript asynchronous programming 4 -- promise error handling
  8. Haikang video SDK development notes (1): introduction and module functions of Hikvision webcam SDK
  9. JOP:用于FPGA的嵌入式实时系统中的Java优化处理器内核
  10. Spring Boot源码:使用MongoDB MongoTemplate公开REST在几分钟内实现CRUD功能
  11. Spring Boot应用程序事件教程 - reflectoring
  12. 带有Resilience4j断路器的Spring云网关 - rome
  13. 经验分享:Apache Kafka的缺点与陷阱 - Emil Koutanov
  14. 通过Spring Boot Webflux实现Reactor Kafka
  15. 从Java 8升级到Java 11应该注意的问题
  16. Jop: Java optimized processor core for FPGA embedded real time system
  17. Spring boot source code: use mongodb mongotemplate to open rest to realize crud function in a few minutes
  18. Spring boot application event tutorial - reflecting
  19. Spring cloud gateway with resilience4j circuit breaker - ROM
  20. Experience sharing: shortcomings and pitfalls of Apache Kafka - Emil koutanov
  21. Realization of reactor Kafka through spring boot Webflux
  22. RPC框架设计----Socket与I/0模型
  23. Problems in upgrading from Java 8 to Java 11
  24. RPC framework design -- socket and I / 0 model
  25. RPC框架设计----I/0模型
  26. RPC framework design: I / 0 model
  27. RPC框架设计----NIO编程缓冲区Buffer
  28. RPC框架设计----NIO编程缓冲区Buffer
  29. RPC framework design -- NiO programming buffer
  30. RPC framework design -- NiO programming buffer
  31. Java多线程基础
  32. Java multithreading Foundation
  33. 码农飞升记-00-Java发展历程
  34. Development history of coder-00-java
  35. 码农飞升记-00-Java发展历程
  36. Development history of coder-00-java
  37. Spring and Autumn Moon
  38. Node.js与Spring Boot比较? - Ryan Gleason
  39. Spring WebFlux的明显陷阱 - ŁukaszKyć
  40. Spring创始人Rod大叔对YAML的真实想法
  41. Compare node.js with spring boot- Ryan Gleason
  42. Obvious pitfalls of spring Webflux- Ł ukaszKy ć
  43. Spring founder uncle rod's real thoughts on yaml
  44. 码农飞升记-02-OracleJDK是什么?OracleJDK的版本怎么选择?
  45. What is manong feisheng-02-oracle JDK? How to choose the version of Oracle JDK?
  46. Spring tide surging Xinanjiang
  47. Linux内核软中断
  48. Linux kernel soft interrupt
  49. Linux内核软中断
  50. Linux kernel soft interrupt
  51. Java multithreading Foundation
  52. The construction of Maven private library nexus
  53. I / O stream in Java
  54. JDK 16:Java 16的新功能 - InfoWorld
  55. 在Java中本地进行线程间数据传输的三种方式和源码展示
  56. jdon导致cpu 99%最后tomcat死掉---banq给予回复
  57. 用领域事件模拟AOP注入
  58. JDK 16: new function of Java 16 - InfoWorld
  59. Cartoon: from JVM lock to redis distributed lock
  60. Spring 3.1 终于加入了Cache支持