java.lang.OutOfMemoryError

Reply

Join Date: Apr 2007
Posts: 126
Reputation: new_2_java is an unknown quantity at this point 
Solved Threads: 6
new_2_java new_2_java is offline Offline
Junior Poster

java.lang.OutOfMemoryError

 
0
  #1
Oct 31st, 2008
Hi all,

I have a threaded program, which migrates contetn from one repository to another. The program works fine, when I test for small number of documents, say arround 10 or 20. But when I increase the number of documents, then I get java.lang.OutOfMemoryError. I can't seem to figure out how to fix this.

I presume it is the JVM which runs out of memory. Can someone please shed some lights arround this. Now, I am not sure if it's my code, or its JVM setting.

Please advise...


Thanks,
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,444
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: java.lang.OutOfMemoryError

 
0
  #2
Oct 31st, 2008
Two options:
1) Give the program more memory with -Xmx: http://java.sun.com/javase/6/docs/te...a.html#options

2) Use less memory. That may involved using a smaller thread pool or limiting buffer sizes for file operations, etc.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,617
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 466
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: java.lang.OutOfMemoryError

 
0
  #3
Oct 31st, 2008
Two reasons come to mind:
- A rogue implementation which manifests itself as the number of documents to be transferred increases. Profile the application thoroughly looking for memory leaks and unintentional object retention.
- The default heap size doesn't suit well for your current processing needs. Tune your JVM by setting an appropriate heap size and garbage collection strategy to suit your needs.

Read this.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC