2012-09-17 110 views
1

因此,我試圖弄清楚爲什麼我們的應用程序偶爾會消耗100%的CPU。我已經閱讀了幾篇非常有用的stackovertflow文章,但我認爲要安全起見,我想得到一些建議......指導......幫助......無論如何。真的,這也是我沒有經驗看堆棧痕跡。我真的很感激,如果有人能指出這裏可能的罪魁禍首,並向我展示如此的指針,所以我可以更好地理解這一點。jstack 100%CPU

值得注意的線程(所以它似乎對我來說)是那些等待顯示器:

 
I get four of these threads consistently jndi-0 - jndi-4 

    "jndi-0" prio=6 tid=0x000000001113e000 nid=0x187c waiting for monitor entry [0x0000000012a9f000] 
     java.lang.Thread.State: BLOCKED (on object monitor) 
     at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:388) 
     - waiting to lock (a java.net.SocksSocketImpl) 
     at java.net.ServerSocket.implAccept(ServerSocket.java:453) 
     at java.net.ServerSocket.accept(ServerSocket.java:421) 
     at jrun.servlet.network.NetworkService.accept(NetworkService.java:356) 
     at jrun.naming.NamingNetworkService.accept(NamingNetworkService.java:115) 
     at jrun.naming.NamingNetworkService.createRunnable(NamingNetworkService.java:141) 
     at jrunx.scheduler.ThreadPool$DownstreamMetrics.createRunnable(ThreadPool.java:287) 
     at jrunx.scheduler.ThreadPool$ThreadThrottle.createRunnable(ThreadPool.java:349) 
     at jrunx.scheduler.ThreadPool$UpstreamMetrics.createRunnable(ThreadPool.java:241) 
     at jrunx.scheduler.WorkerThread.run(WorkerThread.java:62) 
     Locked ownable synchronizers: 
     - None 
 

    "jrpp-298" prio=6 tid=0x0000000014730800 nid=0xdd4 waiting for monitor entry [0x000000001cc4b000] 
     java.lang.Thread.State: BLOCKED (on object monitor) 
     at coldfusion.runtime.LocalScope.put(LocalScope.java:247) 
     - waiting to lock (a coldfusion.runtime.VariableScope) 
     at coldfusion.runtime.NeoPageContext.SymTab_setValidatedSimpleName(NeoPageContext.java:1339) 
     at coldfusion.runtime.NeoPageContext.SymTab_setValidatedDottedName(NeoPageContext.java:1297) 
     at coldfusion.runtime.NeoPageContext.setValidatedAttribute(NeoPageContext.java:524) 
     at coldfusion.runtime.NeoPageContext.setAttribute(NeoPageContext.java:392) 
     at coldfusion.runtime.CfJspPage._set(CfJspPage.java:369) 
     at cfmathFunctions2ecfm1090027769$funcREDUCEBARBASE.runFunction(C:\SIWEB\cfw\controllers\ContentLogic\mathFunctions.cfm:711) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471) 
     at Statement26069.evaluate(:1) 
     at coldfusion.compiler.ExprClassLoader.evaluate(ExprClassLoader.java:143) 
     at coldfusion.runtime.CFPage.Evaluate(CFPage.java:1726) 
     at cfContentLogic2ecfc1938419849$funcEVALUATEFUNCTIONSTRING.runFunction(C:\SIWEB\cfw\controllers\ContentLogic.cfc:479) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436) 
     at cfContentLogic2ecfc1938419849$funcFINDANDEVALUATE.runFunction(C:\SIWEB\cfw\controllers\ContentLogic.cfc:528) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471) 
     at cfContentLogic2ecfc1938419849$funcPREPAREDANSWERSBYQUESTIONIDQGID.runFunction(C:\SIWEB\cfw\controllers\ContentLogic.cfc:340) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436) 
     at cfContentLogic2ecfc1938419849$funcPROCESSDYNAMICITEMBYQUESTIONIDQGID.runFunction(C:\SIWEB\cfw\controllers\ContentLogic.cfc:69) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:320) 
     at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222) 
     at cfitemPackaging2ecfm1230617345$funcPREPAREDITEMBYQUESTIONIDQGID.runFunction(C:\SIWEB\cfw\controllers\ProtectedBusinessLogic\itemPackaging.cfm:693) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436) 
     at cfitemPackaging2ecfm1230617345$funcPREPAREDITEMSANDPASSAGESSTRUCTBYQGID.runFunction(C:\SIWEB\cfw\controllers\ProtectedBusinessLogic\itemPackaging.cfm:408) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436) 
     at cfitemPackaging2ecfm1230617345$funcPREPAREDITEMSANDPASSAGESSTRUCTBYQGIDS.runFunction(C:\SIWEB\cfw\controllers\ProtectedBusinessLogic\itemPackaging.cfm:73) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:320) 
     at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222) 
     at cfpracticesession2ecfm1218050444$funcPRACTICESESSION.runFunction(C:\SIWEB\cfw\controllers\Test\practicesession.cfm:272) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436) 
     at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:432) 
     at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2662) 
     at cfcfml2ecfm667848367$func$INVOKE.runFunction(C:\SIWEB\cfw\wheels\global\cfml.cfm:177) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436) 
     at cfprocessing2ecfm76711320$func$CALLACTION.runFunction(C:\SIWEB\cfw\wheels\controller\processing.cfm:85) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) 
     at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436) 
     at cfprocessing2ecfm76711320$func$PROCESSACTION.runFunction(C:\SIWEB\cfw\wheels\controller\processing.cfm:60) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) 
     at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) 
     at cfrequest2ecfm104933708$func$REQUEST.runFunction(C:\SIWEB\cfw\wheels\dispatch\request.cfm:166) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) 
     at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) 
     at cfindex2ecfm812783003.runPage(C:\SIWEB\cfw\wheels\index.cfm:1) 
     at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196) 
     at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370) 
     at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661) 
     at cfrewrite2ecfm453288076.runPage(C:\SIWEB\cfw\rewrite.cfm:1) 
     at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196) 
     at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370) 
     at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661) 
     at cfonrequest2ecfm951311187$funcONREQUEST.runFunction(C:\SIWEB\cfw\wheels\events\onrequest.cfm:1) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) 
     at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) 
     at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) 
     at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) 
     at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) 
     at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) 
     at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) 
     at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:74) 
     at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:243) 
     at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:269) 
     at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) 
     at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) 
     at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) 
     at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) 
     at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) 
     at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) 
     at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) 
     at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) 
     at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) 
     at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126) 
     at coldfusion.CfmServlet.service(CfmServlet.java:175) 
     at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) 
     at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) 
     at com.intergral.fusionreactor.filter.FusionReactorFilter.k(FusionReactorFilter.java:636) 
     at com.intergral.fusionreactor.filter.FusionReactorFilter.d(FusionReactorFilter.java:266) 
     at com.intergral.fusionreactor.filter.FusionReactorFilter.doFilter(FusionReactorFilter.java:171) 
     at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) 
     at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) 
     at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) 
     at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) 
     at jrun.servlet.FilterChain.service(FilterChain.java:101) 
     at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) 
     at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) 
     at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) 
     at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) 
     at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) 
     at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) 
     at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) 
     at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) 
     at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) 
     Locked ownable synchronizers: 
     - None 

 

    Trace Time: 10:50:51.504 18-Sep-2012Thread ID: 0x19 (25)Thread Name: jndi-3Priority:  5Hashcode:  290417686State:  RUNNABLE"jndi-3" prio=5 runnablejava.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:???)[Native Method]java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)java.net.ServerSocket.implAccept(ServerSocket.java:453)java.net.ServerSocket.accept(ServerSocket.java:421)jrun.servlet.network.NetworkService.accept(NetworkService.java:356)jrun.naming.NamingNetworkService.accept(NamingNetworkService.java:115)jrun.naming.NamingNetworkService.createRunnable(NamingNetworkService.java:141)jrunx.scheduler.ThreadPool$DownstreamMetrics.createRunnable(ThreadPool.java:287)jrunx.scheduler.ThreadPool$ThreadThrottle.createRunnable(ThreadPool.java:349)jrunx.scheduler.ThreadPool$UpstreamMetrics.createRunnable(ThreadPool.java:241)jrunx.scheduler.WorkerThread.run(WorkerThread.java:62) 

+1

這些線程被阻塞,這意味着它們應該使用任何CPU。你能找到RUNNABLE線程嗎? –

+0

被阻塞的線程不使用CPU –

+0

可能有一個線程被鎖定並導致其他人阻塞。並且因爲它不解鎖,顯示器永遠不會繼續。我猜。 – fonZ

回答

0

我第二次的建議,嘗試JVisualVM - 它通過排序是偉大線程。另一個好的選擇是使用Eclipse,它可以讓你在調試模式下單步執行單獨的線程。