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]
.
.
.
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() %>
<%
}
%>