Chinaunix

标题: 内存异常? [打印本页]

作者: tlsljs    时间: 2007-06-15 16:02
标题: 内存异常?
在页面上,有些文本框不输入东西就没事
如果输入就出这个问题
这个问题不是每次都出
15:49:45,296 ERROR [action]:253 - Servlet.service() for servlet action threw exception
java.lang.OutOfMemoryError: Java heap space
15:49:45,484 ERROR systemError_jsp:109 - 发生系统异常
javax.servlet.ServletException: Servlet execution threw an exception
求教各位高手?
作者: tong0245    时间: 2007-06-15 17:19
找到出错的servlet 代码
你到说大街 说有个人 死了 谁知道死因吗?
你也是这样问题的问题?
作者: angus1923    时间: 2007-07-16 12:03
标题: java.lang.OutOfMemoryError: Java heap space
1.是否有大的STRING(或结果集)返回

2.JVM的测试初始化内存设置是多大

3.是不是在同一时段线程突然会增加 最大允许线程是多少

我觉得你可用 设置下JVM的初始化参数和优化下代码
作者: sleepingok    时间: 2007-07-16 14:59
标题: 回复 #1 tlsljs 的帖子
把这2个参数加大

-Xmsn
    Specify the initial size, in bytes, of the memory allocation pool. This value must be a multiple of 1024 greater than 1MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 2MB. Examples:

               -Xms6291456
               -Xms6144k
               -Xms6m
               

-Xmxn
    Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. Examples:

               -Xmx83886080
               -Xmx81920k
               -Xmx80m




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2