<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>涂0实验室 &#187; jvm</title>
	<atom:link href="http://www.sulong.info/archives/tag/jvm/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sulong.info</link>
	<description>一个程序员的成长之路</description>
	<lastBuildDate>Fri, 27 Aug 2010 01:54:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>增大java程序使用的内存</title>
		<link>http://www.sulong.info/archives/50</link>
		<comments>http://www.sulong.info/archives/50#comments</comments>
		<pubDate>Tue, 11 Dec 2007 02:30:15 +0000</pubDate>
		<dc:creator>sulong</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[OutOfMemoryError]]></category>

		<guid isPermaLink="false">http://www.sulong.info/archives/50</guid>
		<description><![CDATA[运行jboss，反复部署应用程序几遍后，往往会发生&#8221;java.lang.OutOfMemoryError: PermGen space&#8221; 这样的错致命错误。这个错误并非是java程序真的把机器内存用光所致，而是用光了“Perm内存”。Perm 实际是 permanent 的缩写，意思是持久的。java虚拟机一般会把应用程序运行的内存空间划分为两大块，一大块是放置运行期间使用的需要要经常变动的数据，如局部变量，实例 变量等，另一大块就是这个Permanent区域，放置类的定义等不怎么变的数据。反复部署应用程序很多遍后，jboss往往难以处理复杂的类依赖关系， 对permanent区域的内存回收更是很困难的，最后导致越用越多，几遍之后这个区域就不够用了，而这个区域又是不能增长的，所以就会出现上面所给出的 错误的。因此，我们可以在jboss的起动脚本里加入下面的配置信息，让java虚拟机加大Perm区的大小，以延缓出现上述错误。要加入的代码如下： -XX:PermSize=128m 在我的1G内存的机器上，我改为如下配置了： set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx768m -XX:PermSize=128m]]></description>
			<content:encoded><![CDATA[<p>运行jboss，反复部署应用程序几遍后，往往会发生&#8221;java.lang.OutOfMemoryError: PermGen space&#8221; 这样的错致命错误。这个错误并非是java程序真的把机器内存用光所致，而是用光了“Perm内存”。Perm 实际是 permanent 的缩写，意思是持久的。java虚拟机一般会把应用程序运行的内存空间划分为两大块，一大块是放置运行期间使用的需要要经常变动的数据，如局部变量，实例 变量等，另一大块就是这个Permanent区域，放置类的定义等不怎么变的数据。反复部署应用程序很多遍后，jboss往往难以处理复杂的类依赖关系， 对permanent区域的内存回收更是很困难的，最后导致越用越多，几遍之后这个区域就不够用了，而这个区域又是不能增长的，所以就会出现上面所给出的 错误的。因此，我们可以在jboss的起动脚本里加入下面的配置信息，让java虚拟机加大Perm区的大小，以延缓出现上述错误。要加入的代码如下：</p>
<p><strong>-XX:PermSize=128m</strong></p>
<p>在我的1G内存的机器上，我改为如下配置了：</p>
<p><strong>set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx768m -XX:PermSize=128m</strong></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.sulong.info/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.sulong.info/archives/50/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
