Linux下tomcat启动jvm内存设置方法:
在/usr/local/apache-tomcat-5.5.23/bin目录下的catalina.sh
添加:JAVA_OPTS='-Xms512m -Xmx1024m'
要加“m”说明是MB,否则就是KB了,在启动tomcat时会报内存不足。
-Xms:初始值
-Xmx:最大值
-Xmn:最小值我按照上面的设置进行修改的。可是我不知道有没有设置成功 windows我也想知道谢谢

解决方案 »

  1.   

    刚才google了下。。楼主试试。public class memory { 
    public static void main(String args[]) { 
    System.out.println("usage:"); 
    memory m=new memory(); 
    long t=m.showUsage(); 
    System.out.println("Total:"+ t + " Bytes"); 
    long fr=m.freeMemory(); 
    //System.gc(); 
    System.out.println("Free:"+fr + " Bytes"); 
    long rem=t-fr; 
    System.out.println("Occupied Space :"+rem + " Bytes"); 

    public long showUsage() { 
    long l=Runtime.getRuntime().totalMemory(); 
    return(l); 

    public long freeMemory() { 
    long f=Runtime.getRuntime().freeMemory(); 
    return(f); 

    }
      

  2.   

    找到一个在eclipse中查看jvm的方法,经测试可用。。http://hi.baidu.com/newfys/blog/item/0379ae09c431fca72eddd4c3.html
      

  3.   

    我可是在服务器上呀! eclipse在服务器上不能安装呀! 有没有其它方法呀!
    兄弟们帮忙一下了