| | |
java.lang.OutOfMemoryError
![]() |
•
•
Join Date: Apr 2007
Posts: 126
Reputation:
Solved Threads: 6
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,
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,
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.
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.
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.
- 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.
![]() |
Similar Threads
- XML Update?? (RSS, Web Services and SOAP)
- OutOfMemory Error (Java)
Other Threads in the Java Forum
- Previous Thread: File Input Exception
- Next Thread: Sunflower program...probably completely wrong...help!
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse editor error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress input integer intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle parsing plazmic print problem program programming project recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows






