websphere6.1的java进程老99.9%占用CPU【已解决】

各位专家好!

    这个问题最近困扰我很久了,在附件中,我截下了当时websphere监控诊断图,希望专家能给我指点一二

谢谢
hima

附件:

附件图标websphere cpu性能问题.rar (18.23 KB)

参与91

82同行回答

谢谢各位的解答,死循环应该是没有,我隐隐约约感觉到问题出在哪,但又说不上来,我的应用用的是JSF开发的,但我在开发过程中,有些地方没有用JSF的导航机制,代码如下,我想问的是,是不是开了太多的Request但又没关闭而引起的,再帮我分析分析,谢谢!/**      &nb...显示全部
谢谢各位的解答,死循环应该是没有,我隐隐约约感觉到问题出在哪,但又说不上来,我的应用用的是JSF开发的,但我在开发过程中,有些地方没有用JSF的导航机制,代码如下,我想问的是,是不是开了太多的Request但又没关闭而引起的,再帮我分析分析,谢谢!
/**
         * 返回到指定页面
         * @param context
         * @param message
         * @param url
         * @return
         * @throws IOException
         */
        public static  boolean  getMessage(FacesContext context,String message,String url ) throws IOException{
                 String contentType = "application/octet-stream;charset=gb2312";
                HttpServletResponse response = (HttpServletResponse) context
                            .getExternalContext().getResponse();
                HttpServletRequest request = (HttpServletRequest) context
            .getExternalContext().getRequest();
                response.setContentType(contentType);
                PrintWriter out = response.getWriter();
                out.print("");
                //response.encodeRedirectURL(url);
                out.flush();
                context.responseComplete();
                out.close();
                return true;
                }
       
        /**
         * 返回到指定页面
         * @param context
         * @param url
         * @return
         * @throws IOException
         */
        public static  boolean  redirect(FacesContext context,String url ) throws IOException{
                 String contentType = "application/octet-stream;charset=gb2312";
                HttpServletResponse response = (HttpServletResponse) context
                            .getExternalContext().getResponse();
                response.setContentType(contentType);
                PrintWriter out = response.getWriter();
                out.print("");
                out.flush();
                context.responseComplete();
                out.close();
                return true;
                }
       
        /**
         * 只提示信息,继续执行
         * @param context
         * @param message
         * @param goon
         * @return
         * @throws IOException
         */
        public static  boolean  getMessage(FacesContext context,String message,boolean goon) throws IOException{
                String contentType = "application/octet-stream;charset=gb2312";
        HttpServletResponse response = (HttpServletResponse) context
                    .getExternalContext().getResponse();
        response.setContentType(contentType);
        PrintWriter out = response.getWriter();
        out.print("");
        
        //out.flush();
        context.responseComplete();
        out.close();
        return true;
                }
       
        /**
         * 异步确认提示
         * @param context
         * @param code
         * @param declare
         * @throws IOException
         */
        public static void confirm(FacesContext context,String code,String declare) throws IOException {
                String contentType = "application/octet-stream;charset=gb2312";
        HttpServletResponse response = (HttpServletResponse) context
                    .getExternalContext().getResponse();
        response.setContentType(contentType);
        PrintWriter out = response.getWriter();
        StringBuffer buf = new StringBuffer();
        buf.append("\n");
        out.print(buf);
        out.flush();
        context.responseComplete();
        }
       
        public static String getResult(FacesContext context,String declare) throws IOException, InterruptedException {
                Map map = context.getExternalContext().getSessionMap();
                map.put("b",null);
                confirm(FacesContext.getCurrentInstance(),"b",declare);       
                int l = 0;
                while (map.get("b") == null) {
                        if (l > 15000) {
                                map.put("b", "false");
                                break;
                        }
                        l = l + 2000;
                        Thread.sleep(2000L);
                }
                return (String)map.get("b");
        }收起
2008-06-05
浏览564
月光无寒月光无寒系统工程师新疆电信
我比较喜欢从数据库反向来看看你应用在做什么。以前99%的问题好像遇见过,杀了重启就没事了。。。你反复出现的话,应该是某块代码被激活,会出现这个问题。看看日志当时有什么报错么?...显示全部
我比较喜欢从数据库反向来看看你应用在做什么。以前99%的问题好像遇见过,杀了重启就没事了。。。你反复出现的话,应该是某块代码被激活,会出现这个问题。看看日志当时有什么报错么?收起
电信运营商 · 2008-06-05
浏览548
huangdoshuangdosCTO深圳乐凯撒股份有限公司
性能监控这一块只能看到内存的使用情况,至于CPU的使用情况,是看不到的。。。显示全部
性能监控这一块只能看到内存的使用情况,至于CPU的使用情况,是看不到的。。。收起
互联网服务 · 2008-06-05
浏览532
艾依然艾依然其它惠牛农业
楼上回答的有道理,先检查有没有死循环之类的。 [ 本帖最后由 艾依然 于 2008-6-5 17:31 编辑 ]显示全部
楼上回答的有道理,先检查有没有死循环之类的。 [ 本帖最后由 艾依然 于 2008-6-5 17:31 编辑 ]收起
互联网服务 · 2008-06-05
浏览513
huangdoshuangdosCTO深圳乐凯撒股份有限公司
CPU 占用率高,估计是有什么程序在不断的执行。。。可别有死循环之类的程序哦。。显示全部
CPU 占用率高,估计是有什么程序在不断的执行。。。
可别有死循环之类的程序哦。。收起
互联网服务 · 2008-06-05
浏览524

提问者

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2008-06-05
  • 关注会员:3 人
  • 问题浏览:61375
  • 最近回答:2016-03-09
  • X社区推广