Results 1 to 4 of 4
  1. #1
    Mrs. Deswal's Avatar
    Mrs. Deswal is offline Member
    Join Date
    Apr 2009
    Location
    Gurgaon,India
    Posts
    24
    Rep Power
    0

    Default Out of memory error

    Hi,

    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.:)

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

    Default

    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.

  3. #3
    Mrs. Deswal's Avatar
    Mrs. Deswal is offline Member
    Join Date
    Apr 2009
    Location
    Gurgaon,India
    Posts
    24
    Rep Power
    0

    Default

    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.:)

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

Similar Threads

  1. How to over come java.lang.out of memory error
    By Chaitra_gm in forum New To Java
    Replies: 5
    Last Post: 09-28-2008, 11:33 AM
  2. Out of memory error in eclipse
    By Java.child in forum New To Java
    Replies: 5
    Last Post: 09-05-2008, 05:50 PM
  3. Low memory error
    By rlhs76 in forum New To Java
    Replies: 2
    Last Post: 02-08-2008, 11:25 PM
  4. How to reduce the size or avoiding out of memory error?
    By rajeshkumarmsc in forum Advanced Java
    Replies: 3
    Last Post: 08-11-2007, 11:15 PM
  5. Java Heap Out of Memory Error
    By stonkers in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 05:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •