CPU 100% and HashMap threads are caused by insecure hashmap threads.

Source: Internet
Author: User

CPU 100% and HashMap threads are caused by insecure hashmap threads.

Recently, the Application Server Reports CPU usage of 100% from time to time, which is 100% for multiple CPUs. Finally, it is found that the HashMap used in the jar package aspectjweaver is thread unsafe. The conclusion of this accident is that third-party jar packages should always be concerned.

<08:12:44 P.M. CST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '13' for queue: 'weblogic. kernel. default (self-tuning) 'has been busy for "657" seconds working on the request "weblogic. servlet. internal. servletRequestImpl @ 49f969a [

POST/web/gg/workflow/fore/DoSpecialForeSubmit. jsp? IsProgress = false https/1.1
X-Forwarded-For: 10.124.19.6
Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml + xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/vnd. ms-excel, application/vnd. ms-powerpoint, application/msword ,*/*
Referer: http: // 10.150.140.20/web/gg/material/workflow/fore/SelForePersons. jsp? PCount = 1 & pFlowKey = GMM_DataLabel_ForCSG & pAllFlag = false & pReturnURL =/web/gg/groupmaterial/audit/purchaseplan/csgpchasureplanaudit. jsp? PageNo = 1 | status = auditing | nodeString = null: null; GMM_DataLabel_ForCSG; 000004 | frameName = bytes | labelType = 20 & pAdapterClass = bytes & pWorkFlowId = undefined & pAreaCode = undefined & Signature = false & pShowRoleFilter = false & pFlag = undefined & pModulePath = gg/material & pSubmitCallback = loading () & pIsAsync = false & pIsProgress = undefined & pReadAllPage = undefined
Accept-Language: zh-CN
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; mozilla/4.0 (Compatible Mozilla/4.0 (Compatible-EmbeddedWB 14.58 http://bsalsa.com/EmbeddedWB-14.58 from: http://bsalsa.com/; Mozilla/4.0 (Compatible RogueCleanerEmbeddedWB-14.58 from: http://bsalsa.com/; SLCC2 ;. net clr 2.0.50727 ;. net clr 3.5.30729 ;. net clr 3.0.30729; Media Center PC 6.0 ;. NET4.0C ;. NET4.0E; BRI/2; Tablet PC 2.0; InfoPath.3)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Content-Length: 792
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: 6E198C893C55D08419683DCDAA6E3463 = 07D9F9949578C1F56F881944EED7BF65; priority = priority; JSESSIONIDMINI = priority! -2010002315; JSESSIONIDIPMS = qnT2V7BTS1bnczD8VBXwGdX8xBgN451CLKrGKHsRnfkNM5P12RDQ! 1786716604; ComtopSessionSID = <Snid> gS9YV7BYzjN3TnFYHht3F8Tvhj7ZMZxc4ntSnc1vBTGcVDnLh9QL! 64005734! 1429963256371 </snail ID>

] ", Which is more than the configured time (StuckThreadMaxTime) of" 600 "seconds. Stack trace:
Java. util. WeakHashMap. getEntry (WeakHashMap. java: 383)
Java. util. WeakHashMap. containsKey (WeakHashMap. java: 369)
Com. bea. core. repackaged. aspectj. lang. reflect. AjTypeSystem. getAjType (AjTypeSystem. java: 37)
Com. bea. core. repackaged. springframework. aop. aspectj. annotation. AbstractAspectJAdvisorFactory. isAspect (AbstractAspectJAdvisorFactory. java: 113)
Com. bea. core. repackaged. springframework. aop. aspectj. annotation. BeanFactoryAspectJAdvisorsBuilder. buildAspectJAdvisors (BeanFactoryAspectJAdvisorsBuilder. java: 95)
Com. bea. core. repackaged. springframework. jee. intercept. InterceptionMetadata. addAspectJAdvisors (InterceptionMetadata. java: 835)
Com. bea. core. repackaged. springframework. jee. intercept. InterceptionMetadata. createProxyIfNecessary (InterceptionMetadata. java: 477)
Com. bea. core. repackaged. springframework. jee. intercept. InterceptionMetadata. createProxyIfNecessary (InterceptionMetadata. java: 410)
Com. bea. core. repackaged. springframework. jee. spi. EjbComponentCreatorBrokerImpl. invokeCreateProxyIfNecessary (EjbComponentCreatorBrokerImpl. java: 97)
Com. bea. core. repackaged. springframework. jee. spi. EjbComponentCreatorBrokerImpl. getBean (EjbComponentCreatorBrokerImpl. java: 53)
Weblogic. ejb. container. injection. EjbComponentCreatorImpl. getBean (EjbComponentCreatorImpl. java: 67)
Weblogic. ejb. container. manager. BaseEJBManager. createNewBeanInstance (BaseEJBManager. java: 216)
Weblogic. ejb. container. manager. BaseEJBManager. allocateBean (BaseEJBManager. java: 233)
Weblogic. ejb. container. manager. StatelessManager. createBean (StatelessManager. java: 303)
Weblogic. ejb. container. pool. StatelessSessionPool. createBean (StatelessSessionPool. java: 190)
Weblogic. ejb. container. pool. StatelessSessionPool. getBean (StatelessSessionPool. java: 121)
Weblogic. ejb. container. manager. StatelessManager. preInvoke (StatelessManager. java: 148)
Weblogic. ejb. container. internal. BaseRemoteObject. preInvoke (BaseRemoteObject. java: 227)
Weblogic. ejb. container. internal. StatelessRemoteObject. preInvoke (StatelessRemoteObject. java: 52)
Com. gg. masterdata. objecttrack. appservice. impl. ObjectTrackSes_gtdbkl_IObjectTrackServiceImpl.processingTrackRecord (ObjectTrackSes_gtdbkl_IObjectTrackServiceImpl.java: 899)
Com. gg. masterdata. objecttrack. appservice. impl. ObjectTrackSes_gtdbkl_IObjectTrackServiceImpl_CBV.processingTrackRecord (Unknown Source)
Sun. reflect. NativeMethodAccessorImpl. invoke0 (Native Method)


Com. bea. core. repackaged. aspectj. aspectjweaver_5.1.0.jar
Package com. bea. core. repackaged. aspectj. lang. reflect;
Import com. bea. core. repackaged. aspectj. internal. lang. reflect. AjTypeImpl;
Import java. lang. ref. WeakReference;
Import java. util. Map;
Import java. util. WeakHashMap;
Public class AjTypeSystem {
Private static Map <Class, WeakReference <AjType> ajTypes = new WeakHashMap ();
Public static <T> AjType <T> getAjType (Class <T> fromClass ){
If (ajTypes. containsKey (fromClass )){
WeakReference weakRefToAjType = (WeakReference) ajTypes
. Get (fromClass );
AjType theAjType = (AjType) weakRefToAjType. get ();
If (theAjType! = Null ){
Return theAjType;
}
TheAjType = new AjTypeImpl (fromClass );
AjTypes. put (fromClass, new WeakReference (theAjType ));
Return theAjType;
}

AjType theAjType = new AjTypeImpl (fromClass );
AjTypes. put (fromClass, new WeakReference (theAjType ));
Return theAjType;
}
}


Com. bea. core. repackaged. aspectj. aspectjweaver_5.3.0.jar
Package com. bea. core. repackaged. aspectj. lang. reflect;
Import com. bea. core. repackaged. aspectj. internal. lang. reflect. AjTypeImpl;
Import java. lang. ref. WeakReference;
Import java. util. Collections;
Import java. util. Map;
Import java. util. WeakHashMap;
Public class AjTypeSystem {
Private static Map <Class, WeakReference <AjType> ajTypes = Collections
. SynchronizedMap (new WeakHashMap ());


Public static <T> AjType <T> getAjType (Class <T> paramClass ){
WeakReference localWeakReference = (WeakReference) ajTypes
. Get (paramClass );
If (localWeakReference! = Null ){
LocalObject = (AjType) localWeakReference. get ();
If (localObject! = Null)
Return localObject;
LocalObject = new AjTypeImpl (paramClass );
AjTypes. put (paramClass, new WeakReference (localObject ));
Return localObject;
}
Object localObject = new AjTypeImpl (paramClass );
AjTypes. put (paramClass, new WeakReference (localObject ));
Return (AjType <T>) localObject );
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.