首页 » JAVA » jboss 占用高cpu 的诊断思路

jboss 占用高cpu 的诊断思路

top - 14:32:11 up 104 days, 20:27,  1 user,  load average: 19.31, 19.10, 19.06
Tasks: 390 total,  19 running, 371 sleeping,   0 stopped,   0 zombie
Cpu(s): 99.5%us,  0.1%sy,  0.0%ni,  0.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8164276k total,  8111804k used,    52472k free,   403596k buffers
Swap: 16386292k total,      224k used, 16386068k free,  5560532k cached


[root@webxxx ~]# ps -ef|grep 

root     31799 31766 99 Nov08 ?        12-04:08:00 /usr/local/jdk1.6.0_16/bin/java ...

[root@webxxx ~]# cd /usr/local/jdk1.6.0_16/bin/

[root@webxxx bin]# ./jps
29180 Jps
31799 Main
[root@webxxx bin]# top -H -p 31799 


  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                        
31907 root      19   0 2713m 924m  26m R 99.8 11.6   2831:52 java                                                                                           
31970 root      25   0 2713m 924m  26m R 99.8 11.6   2143:46 java                                                                                           
31980 root      19   0 2713m 924m  26m R 99.8 11.6   2831:51 java                                                                                           
31983 root      19   0 2713m 924m  26m R 99.8 11.6   3738:05 java                                                                                           
32032 root      25   0 2713m 924m  26m R 99.8 11.6   2143:43 java 
...

[root@webxxx bin]# ps -e -T |grep 31799|grep -v gpre|wc -l
230


[root@webxxx bin]# ./jstack 31799 >b.txt

-- Converted Thread id to hexadecimal

sys@ANBOB>select to_char(31907,'xxxxxxx') from dual;

TO_CHAR(
--------
    7ca3
	
-- stack trace--

[root@webxxx bin]# grep -A 50 7ca3 b.txt
"http-0.0.0.0-8080-4" daemon prio=10 tid=0x08f4c400 nid=0x7ca3 runnable [0x5460d000]
   java.lang.Thread.State: RUNNABLE
        at java.util.HashMap.put(HashMap.java:374)
        at com.haoyisheng.util.config.HqlManager.getHql(HqlManager.java:57)
        at com.haoyisheng.dao.hibernateimpl.BaseDAOImpl.findBySQL(BaseDAOImpl.java:393)
        at com.ggws.user.service.impl.UserServiceImpl.userStudy(UserServiceImpl.java:944)
        at com.ggws.user.service.impl.UserServiceImpl$$FastClassByCGLIB$$d570f5f3.invoke()
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
        at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)
        at com.ggws.user.service.impl.UserServiceImpl$$EnhancerByCGLIB$$2dc9cd58.userStudy()
        at com.ggws.user.action.UserAction.userstudyOver(UserAction.java:257)
        at sun.reflect.GeneratedMethodAccessor787.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
        at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
        at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
        at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
        at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
[root@webxxx bin]# 

–找专人分析stack

打赏

目前这篇文章有1条评论(Rss)评论关闭。

  1. 你我知 | #1
    2013-11-15 at 11:06

    网站弄得挺不错,支持一下!!!!