<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Does Java garbage collection guarantee that a program will not run out of memory?</title>
	<atom:link href="http://javapapers.com/core-java/does-java-garbage-collection-guarantee-that-a-program-will-not-run-out-of-memory/feed/" rel="self" type="application/rss+xml" />
	<link>http://javapapers.com/core-java/does-java-garbage-collection-guarantee-that-a-program-will-not-run-out-of-memory/</link>
	<description>Blog on core java, servlets, jsp and design patterns.</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:56:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Achal</title>
		<link>http://javapapers.com/core-java/does-java-garbage-collection-guarantee-that-a-program-will-not-run-out-of-memory/#comment-9315</link>
		<dc:creator>Achal</dc:creator>
		<pubDate>Mon, 16 Jan 2012 06:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://javapapers.com/?p=19#comment-9315</guid>
		<description>nice example....</description>
		<content:encoded><![CDATA[<p>nice example&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ghjg</title>
		<link>http://javapapers.com/core-java/does-java-garbage-collection-guarantee-that-a-program-will-not-run-out-of-memory/#comment-4930</link>
		<dc:creator>ghjg</dc:creator>
		<pubDate>Thu, 05 May 2011 13:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://javapapers.com/?p=19#comment-4930</guid>
		<description>vbngfhjg</description>
		<content:encoded><![CDATA[<p>vbngfhjg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chandana</title>
		<link>http://javapapers.com/core-java/does-java-garbage-collection-guarantee-that-a-program-will-not-run-out-of-memory/#comment-3691</link>
		<dc:creator>chandana</dc:creator>
		<pubDate>Wed, 23 Feb 2011 09:22:56 +0000</pubDate>
		<guid isPermaLink="false">http://javapapers.com/?p=19#comment-3691</guid>
		<description>It is perfectly possible for a programmer to mistakingly create objects which never go out of scope, thus consuming more and more memory until all heap is exhausted.

It is the programmer&#039;s responsibility to ensure that objects no longer in use are no longer referenced by the application. That way the garbage collector can do its job and reclaim memory used by these objects.

Try out the following code and check wether the GC guarentee that this application will not run out of memory

public class Main {   
 public static void main(String[] main) {     
 List l = new LinkedList();       
 // Enter infinite loop which will add a String to  the list: l on each iteration.      
do {      
  l.add(new String(&quot;Hello, World&quot;));     
 } while(true);   
 }
  }</description>
		<content:encoded><![CDATA[<p>It is perfectly possible for a programmer to mistakingly create objects which never go out of scope, thus consuming more and more memory until all heap is exhausted.</p>
<p>It is the programmer&#8217;s responsibility to ensure that objects no longer in use are no longer referenced by the application. That way the garbage collector can do its job and reclaim memory used by these objects.</p>
<p>Try out the following code and check wether the GC guarentee that this application will not run out of memory</p>
<p>public class Main {<br />
 public static void main(String[] main) {<br />
 List l = new LinkedList();<br />
 // Enter infinite loop which will add a String to  the list: l on each iteration.<br />
do {<br />
  l.add(new String(&#8220;Hello, World&#8221;));<br />
 } while(true);<br />
 }<br />
  }</p>
]]></content:encoded>
	</item>
</channel>
</rss>

