[PJUG Javamail] Java Memory Management

Bill Kayser bill at kayser.org
Tue Jan 1 22:03:35 UTC 2008


Blow up as in OutOfMemoryError thrown?  The JVM crashes?


  _____  

From: Chris Kessel/Lou Doherty [mailto:chriskessel at verizon.net] 
Sent: Tuesday, January 01, 2008 1:57 PM
To: 'Bill Kayser'; 'Douglas Bullard'; 'Carlus Henry'
Cc: 'Javamail'
Subject: Re: [PJUG Javamail] Java Memory Management


I was going to say, "Yea, it's easy", but that was a couple JVM iterations
ago.
 
Basically, a main with a for loop that allocates an array of 1000 elements
over and over and over. It'll blow up as the GC can't keep up with it.  

  _____  

From: javamail-bounces at pjug.org [mailto:javamail-bounces at pjug.org] On Behalf
Of Bill Kayser
Sent: Tuesday, January 01, 2008 1:37 PM
To: 'Douglas Bullard'; 'Carlus Henry'
Cc: 'Javamail'
Subject: Re: [PJUG Javamail] Java Memory Management


That's a neat trick.  I'd love to hear the details on that.  Do you mean
that you ran out of memory before the GC could clean everything up?  I'm
pretty sure I could write a program that did nothing but allocate memory
(non rooted) and I can't imagine the JVM would fall over. 


You can swamp the garbage collector by creating too many objects, generating
them faster than it can collect them - we've run into that with Hibernate at
work.  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://javac.com/pipermail/javamail/attachments/20080101/d2776c58/attachment-0002.html>


More information about the Javamail mailing list