Results 1 to 4 of 4
Thread: Out of memory error
- 07-17-2009, 06:35 AM #1
Out of memory error
Iam running a java application through commandline on centOS operating system. This is multithreaded application. Also I am giving memory usage of 1024MB to this application. I am running 10 threads in this application. Program is very slow and threads are stopped automatically before complete execution of the thread. At last out of memory error occurred having java heap space problem. This is crawler application so this doesn't consume lot of memory. can anyone help me in solving this problem.Sharing knowledge means gaining more knowledge.:)
- 07-28-2009, 07:53 AM #2
Ten threads is not the problem, unless centOS doesn't do threads well.
Do your threads, as they loop, have a Thread.sleep(), even for 1 millisecond? That can lead to sluggish behavior, if they never take a break.
Make sure you declare all your local fields outside of any loop; otherwise, you will continue create new fields on the stack, and that could get ahead of gc, or at least cause gc to run frequently, slowing things down.
Most likely, you are holding references to objects, so they cannot be gc'ed. Look for lists that are not cleared.
Most important, look for pairs of objects that refer to each other. gc cannot remove these objects.
- 07-29-2009, 11:49 AM #3
Thanks Steve, for replying.
I am analyzing the application with visualVM monitoring tool. But while running both the application and monitoring tool, my application is terminated giving JVM error. Can you please tell me something about this problem.Sharing knowledge means gaining more knowledge.:)
- 07-30-2009, 03:27 AM #4
- By Chaitra_gm in forum New To JavaReplies: 5Last Post: 09-28-2008, 10:33 AM
- By Java.child in forum New To JavaReplies: 5Last Post: 09-05-2008, 04:50 PM
- By rlhs76 in forum New To JavaReplies: 2Last Post: 02-08-2008, 10:25 PM
- By rajeshkumarmsc in forum Advanced JavaReplies: 3Last Post: 08-11-2007, 10:15 PM
- By stonkers in forum New To JavaReplies: 3Last Post: 07-17-2007, 04:43 PM