943,590 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 505
  • Java RSS
Oct 31st, 2008
0

java.lang.OutOfMemoryError

Expand Post »
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,
Similar Threads
Reputation Points: 7
Solved Threads: 6
Junior Poster
new_2_java is offline Offline
127 posts
since Apr 2007
Oct 31st, 2008
0

Re: java.lang.OutOfMemoryError

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.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,756 posts
since May 2007
Oct 31st, 2008
0

Re: java.lang.OutOfMemoryError

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.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: File Input Exception
Next Thread in Java Forum Timeline: Sunflower program...probably completely wrong...help!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC