java.lang.OutOfMemoryError: PermGen space

TOMCAT\bin\catalina.bat,加入:
.
.
.
echo Using CATALINA_BASE: %CATALINA_BASE%
[b][color=red]set JAVA_OPTS=%JAVA_OPTS% -server -XX:PermSize=512m -XX:MaxPermSize=1024m[/color][/b]
echo Using CATALINA_HOME: %CATALINA_HOME%
.
.
.


或者在eclipse里run dialog的Arguments的VM arguments的最后加上这句话:
[color=red]-Xms512m -Xmx1024m -XX:MaxNewSize=256M -XX:MaxPermSize=256M[/color]
[img]http://dl.iteye.com/upload/attachment/284181/aed775ae-f247-3900-b752-fcc420716d08.png[/img]


[url]http://www.blogjava.net/allen-zhe/archive/2007/12/18/168556.html[/url]
[url]http://kakashi.iteye.com/blog/383646[/url]

[b]检查jvm的代码[/b]

<%@ page import="java.lang.management.*" %>
<%@ page import="java.util.*" %>
JVM Memory Monitor

<%
Iterator iter = ManagementFactory.getMemoryPoolMXBeans().iterator();
while (iter.hasNext())
{
MemoryPoolMXBean item = (MemoryPoolMXBean) iter.next();
%>
Memory MXBean
Heap Memory Usage<%=
ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()
%>
Non-Heap Memory
Usage<%=
ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage()
%>
<%} %>

Memory Pool MXBeans
<%
iter = ManagementFactory.getMemoryPoolMXBeans().iterator();
while (iter.hasNext())
{
MemoryPoolMXBean item = (MemoryPoolMXBean) iter.next();
%>

<%= item.getName() %>
Type<%= item.getType() %>
Usage<%= item.getUsage() %>
Peak Usage<%= item.getPeakUsage() %>
Collection Usage<%= item.getCollectionUsage() %>
<%
}

%>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值