cpu:2.8G
内存:512M
win2000 server

解决方案 »

  1.   

    1、在服务器上加内存条,你的机子做服务器才512内存,太小了。
    2、加在Tomcat占内存量。一般Tomcat只使用128的内存,你可能通过加参数,来扩大Tomcat的内存占用量。细节你可以在网上查很多的。
      

  2.   

    %90是你的连接没有关闭。给你一段砌底关闭连接的代码吧 try
         {
           conn=sfca.common.ConnectionManager.getConnection();
           
           try
           {
              stmt=conn.createStatement();
              
           try
           {
           rs=stmt.executeQuery(sql);
               while(rs.next())
               {   
               }
           }
           finally
           {
                  rs.close();
      rs=null;
           }
        
           }
           finally
           { 
           stmt.close();
           stmt=null;
           }
         }
         finally
         {
            conn.close();
         conn=null;
         }
      

  3.   

    我的代码是这样写的(伪代码):
    conn = null;
    stmt = null;
    rs = null
    try
    {
           conn=sfca.common.ConnectionManager.getConnection();
           stmt=conn.createStatement();
           rs = stmt.executeQuery(sql);
           while(rs.next())
           {
              ....
           }
    }
    catch(Exception e)
    {
           e.printerror();
    }
    finally
    {
           if( rs != null )
                rs.close();
           if( stmt != null )
                stmt.close();
           if( conn != null )
                conn.close();}
      

  4.   

    这样应该能够彻底关闭连接吧?
    是不是TOMCAT的配置问题呢?为什么会导致数据库服务器CPU忙呢?。
    郁闷!!各位高手,帮帮忙啊!
      

  5.   

    没有用连接池
    发现有3个jsp中没有关闭连接,关闭之后该问题就没有了.
    不知道是巧合还是真的改好了.!!为什么才3个jsp页面泄露,会导致这么快就导致这么严重的事情?
    (我曾尝试在某jsp页种循环1000次,让连接泄露,却也不出问题,着又是为什么呢?
    希望高手耐心为我解惑.
    谢谢了!!!
      

  6.   

    jsp里面有没有调用自定义的函数或存储过程?
    如果存储过程或函数里面创建了非临时表,会有问题的
      

  7.   

    你试试用tomcat的连接池
    极大可能性是你没有关闭不用的数据库连接