Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/389.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jstack 100%CPU_Java_Multithreading_Cpu_Jrun_Jstack - Fatal编程技术网

Java jstack 100%CPU

Java jstack 100%CPU,java,multithreading,cpu,jrun,jstack,Java,Multithreading,Cpu,Jrun,Jstack,所以我一直在试图弄清楚为什么我们的应用程序偶尔会消耗100%的CPU。我已经阅读了一些非常有用的StackOverflow帖子,但我认为为了安全起见,我想得到一些建议…指导。。。援助…随便什么。实际上,这也是因为我缺乏查看堆栈跟踪的经验。如果有人能在这里指出可能的罪魁祸首,并给我指点,让我更好地理解这一点,我将不胜感激 在我看来,值得注意的线程是等待监视器的线程: I get four of these threads consistently jndi-0 - jndi-4 "jnd

所以我一直在试图弄清楚为什么我们的应用程序偶尔会消耗100%的CPU。我已经阅读了一些非常有用的StackOverflow帖子,但我认为为了安全起见,我想得到一些建议…指导。。。援助…随便什么。实际上,这也是因为我缺乏查看堆栈跟踪的经验。如果有人能在这里指出可能的罪魁祸首,并给我指点,让我更好地理解这一点,我将不胜感激

在我看来,值得注意的线程是等待监视器的线程:

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
我支持使用JVisualVM的建议——它非常适合对线程进行排序。另一个好的选择是使用Eclipse,这将允许您在调试模式下单步执行各个线程。

这些线程被阻塞,这意味着它们应该使用任何CPU。你能找到可运行的线程吗?可能有一个线程被锁定,导致其他线程被阻塞。而且因为它没有解锁,监视器永远无法继续。我猜。你发布的堆栈跟踪是被阻塞的线程,因此目前不消耗任何CPU。发现哪些线程正在使用所有CPU的最简单方法是将探查器附加到应用程序:此类探查器的示例有JProfiler,甚至是免费提供的JVisualVM。您还可以使用一些命令行实用程序来发现占用CPU的线程的堆栈跟踪。以一个>值得注意的线程为例,在我看来,它们似乎是等待>监视器的线程:实际上,这些线程不值得注意,因为它们处于等待状态,并且不消耗CPU。您应该检查正在运行的线程。要么某个线程做了CPU密集型的事情,那么糟糕吗?你能改进一下吗?你应该知道,我脑海中浮现的是一把活锁。您的线程为CPU提供内容,但没有真正的进展。如果你的进程完成了它的工作,但只是消耗了太多的CPU,你可以排除活动锁。所以我很确定这是我发布的最后一个线程导致阻塞 "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)