Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Java Heap Space Error

    hey guys,
    i got a bit of a problm here...i hav a java code to generate pdf files.
    this should generate roughly around 14000 pdf files(depending on the value in the database).
    whenevr i run this program the execution halts at a little more than 800 files after that i have to manually change the query to generate the files after that specified number. its a bit annoying to do this task in lots of 800.
    the error i get is

    " Exception in thread "main" java.lang.OutOfMemoryError: Java heap space "

    request you to kindly help me with suggestions if any...
    thnx a lot
    god bless...
    :)

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,950
    Rep Power
    19

    Default Re: Java Heap Space Error

    You are probably holding onto the data after you need it.
    Exactly how, can't say, as we can't see your code.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Join Date
    Mar 2012
    Posts
    2
    Rep Power
    0

    Default Re: Java Heap Space Error

    hey tolls,

    i have used vectors to hold the data coming from the database and cleared the vector after use for each case at the end of the loop using the clear() method.
    i evn tried the gc method but ntg has helpd... :(

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,950
    Rep Power
    19

    Default Re: Java Heap Space Error

    Yes, but how does your PDF code work?
    Could it be holding onto the data between file creation?

    If it's not obvious then you'll need to take a heap dump and analyse it, possibly in something like Eclipse-MAT.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. programatically fix HEAP SPACE error
    By nin888 in forum New To Java
    Replies: 1
    Last Post: 11-14-2011, 08:47 AM
  2. Java Heap space error using ArrayList.
    By AcousticBruce in forum New To Java
    Replies: 13
    Last Post: 01-03-2011, 01:06 PM
  3. Replies: 5
    Last Post: 08-13-2010, 10:04 AM
  4. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 09:31 AM
  5. Java heap space error
    By gezzel in forum New To Java
    Replies: 19
    Last Post: 09-25-2008, 12:07 AM

Posting Permissions

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