<?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>Java堂 &#187; exception</title>
	<atom:link href="http://www.javatang.com/archives/tag/exception/feed" rel="self" type="application/rss+xml" />
	<link>http://www.javatang.com</link>
	<description>Java Tang</description>
	<lastBuildDate>Thu, 08 Dec 2011 08:29:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Java 中“Error occurred during initialization of VM”错误的解决方法</title>
		<link>http://www.javatang.com/archives/2006/08/11/170654.html</link>
		<comments>http://www.javatang.com/archives/2006/08/11/170654.html#comments</comments>
		<pubDate>Fri, 11 Aug 2006 10:17:06 +0000</pubDate>
		<dc:creator>Jet</dc:creator>
				<category><![CDATA[JavaPlateform]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[jvm]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[最近一段时间一直运行正常的程序今天突然发现无法启动，出现如下提示： Error occurred during initialization of VM Could not reserve enough space for object heap 根据错误的提示初步判断是因为Java虚拟机内存设置的问题，查看了程序启动参数如下： java -Xms512m -Xmx2024 com.javatang.MyApp  原来是设置内存的时候最大内存后面没有设置单位，于是修改为 java -Xms512m -Xmx2024m com.javatang.MyApp 可是运行程序还是出现上面的错误，突然想到前几天服务器的内存撤掉了一根，现在只有3G了，设置的最大内存可能太多了，于是又修改如下 java -Xms512m -Xmx1024m com.javatang.MyApp 运行之后一切就正常了。 参考资料： 解决JB 2005不能启动的问题 http://www.dragonsoft.net.cn/Blog/Show.asp?BlogID=151 JVM的垃圾回收机制详解和调优-附PDM应用实例 http://www.matrix.org.cn:8080/jmatrix/resource/article/43/43769_JVM_GC_PDM.html Related Posts:JRebel运行缓慢或提示内存不足的解决方法由MyEclipse内存不足谈谈JVM内存Oracle中的”值和null以及java中的null区别Java中文排序遇到一个JDK5.0 Update7 以前的bug]]></description>
			<content:encoded><![CDATA[<p>最近一段时间一直运行正常的程序今天突然发现无法启动，出现如下提示：</p>
<blockquote><p>Error occurred during initialization of VM<br />
Could not reserve enough space for object heap</p></blockquote>
<p>根据错误的提示初步判断是因为Java虚拟机内存设置的问题，查看了程序启动参数如下：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">java -Xms512m -Xmx2024 com.javatang.MyApp</li></ol></div>
<p> 原来是设置内存的时候最大内存后面没有设置单位，于是修改为</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">java -Xms512m -Xmx2024m com.javatang.MyApp</li></ol></div>
<p>可是运行程序还是出现上面的错误，突然想到前几天服务器的内存撤掉了一根，现在只有3G了，设置的最大内存可能太多了，于是又修改如下</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">java -Xms512m -Xmx1024m com.javatang.MyApp</li></ol></div>
<p>运行之后一切就正常了。</p>
<p>参考资料：<br />
解决JB 2005不能启动的问题<br />
<a target="_blank" href="http://www.dragonsoft.net.cn/Blog/Show.asp?BlogID=151">http://www.dragonsoft.net.cn/Blog/Show.asp?BlogID=151</a><br />
JVM的垃圾回收机制详解和调优-附PDM应用实例<br />
<a target="_blank" href="http://www.matrix.org.cn:8080/jmatrix/resource/article/43/43769_JVM_GC_PDM.html">http://www.matrix.org.cn:8080/jmatrix/resource/article/43/43769_JVM_GC_PDM.html</a></p>
<div id="crp_related"><h2>Related Posts:</h2><ul><li><a href="http://www.javatang.com/archives/2010/11/29/3337530.html" rel="bookmark" class="crp_title">JRebel运行缓慢或提示内存不足的解决方法</a></li><li><a href="http://www.javatang.com/archives/2007/12/03/1653250.html" rel="bookmark" class="crp_title">由MyEclipse内存不足谈谈JVM内存</a></li><li><a href="http://www.javatang.com/archives/2006/06/13/242443.html" rel="bookmark" class="crp_title">Oracle中的”值和null以及java中的null区别</a></li><li><a href="http://www.javatang.com/archives/2007/03/05/5722110.html" rel="bookmark" class="crp_title">Java中文排序</a></li><li><a href="http://www.javatang.com/archives/2006/10/10/444472.html" rel="bookmark" class="crp_title">遇到一个JDK5.0 Update7 以前的bug</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.javatang.com/archives/2006/08/11/170654.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQLServerException: DBComms.receive产生的原因</title>
		<link>http://www.javatang.com/archives/2006/04/28/053226.html</link>
		<comments>http://www.javatang.com/archives/2006/04/28/053226.html#comments</comments>
		<pubDate>Thu, 27 Apr 2006 16:05:32 +0000</pubDate>
		<dc:creator>Jet</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[JavaPlateform]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[使用SQLServer2005的JDBC进行SQL Server2000的操作, 程序中使用了多线程的”Worker Thread”模式, 但是在运行的过程中偶尔会产生这样的SQLServerException: 使用 DBComms.receive 方法期间发生异常。操作:socket closed。上下文:(9) [Thread[Thread-8,5,main], IO:897a 9, Dbc:null]。PktNum:0。TotalReceived:0。PktSize:4,096。 后来查了一些有限的资料, 终于知道了原因所在. 原来是因为程序中的代码是非线程安全的, JDBC对象是不能被多个线程共用的. 产生这个异常的原因可能是一个线程中Connection正在关闭或Statement正在被重新执行的时候另一个线程正在使用. Hi. I suspect it’s your application code (including the dbcp stuff) that may not be threadsafe. Your JDBC objects can’t be shared by multiple threads. I suspect a connection is being closed, or a statement is being [...]]]></description>
			<content:encoded><![CDATA[<p class="storycontent">使用SQLServer2005的JDBC进行SQL Server2000的操作, 程序中使用了多线程的”Worker Thread”模式, 但是在运行的过程中偶尔会产生这样的SQLServerException:</p>
<blockquote><p>使用 DBComms.receive 方法期间发生异常。操作:socket closed。上下文:(9) [Thread[Thread-8,5,main], IO:897a<br />
9, Dbc:null]。PktNum:0。TotalReceived:0。PktSize:4,096。</p></blockquote>
<p>后来查了一些有限的资料, 终于知道了原因所在<a id="more-26"></a>. 原来是因为程序中的代码是非线程安全的, JDBC对象是不能被多个线程共用的. 产生这个异常的原因可能是一个线程中Connection正在关闭或Statement正在被重新执行的时候另一个线程正在使用.</p>
<blockquote><p>Hi. I suspect it’s your application code (including the dbcp stuff) that may not be threadsafe. Your JDBC objects can’t be shared by multiple threads. I suspect a connection is being closed, or a statement is being re-executed by one thread while another is still using it.<br />
Joe Weinstein at BEA Systems</p></blockquote>
<p>参考资料:<br />
<a target="_blank" href="http://www.webservertalk.com/archive135-2006-2-1390423.html">http://www.webservertalk.com/archive135-2006-2-1390423.html</a></p>
<div id="crp_related"><h2>Related Posts:</h2><ul><li><a href="http://www.javatang.com/archives/2006/04/14/455118.html" rel="bookmark" class="crp_title">昨晚做的两个菜</a></li><li><a href="http://www.javatang.com/archives/2006/05/10/293234.html" rel="bookmark" class="crp_title">拿到了SQL Server JDBC V1.1 CTP驱动</a></li><li><a href="http://www.javatang.com/archives/2006/05/07/002930.html" rel="bookmark" class="crp_title">SQL Server JDBC 1.0中提高Select的效率</a></li><li><a href="http://www.javatang.com/archives/2006/10/17/495674.html" rel="bookmark" class="crp_title">迟到的报道－ SQLServer2005 JDBC v1.1正式版发布</a></li><li><a href="http://www.javatang.com/archives/2006/06/13/242443.html" rel="bookmark" class="crp_title">Oracle中的”值和null以及java中的null区别</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.javatang.com/archives/2006/04/28/053226.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.javatang.com @ 2012-02-06 02:03:42 -->
