Results 1 to 4 of 4
  1. #1
    suyog53 is offline Member
    Join Date
    Sep 2012
    Location
    Navi Mumbai
    Posts
    30
    Rep Power
    0

    Question How to solve "Heap Space" error...?'

    There is a text file containing numbers whose size is 7673 Kb'
    Whenever i run program to replace all numbers to alphabets, for this file i get error as....
    java.lang.OutOfMemoryError: Java heap space
    '
    The program works normal and correct for files till 2000 kb(till which i tried)'
    '
    Plz help...'

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default Re: How to solve "Heap Space" error...?'

    How are you processing the data? Do you try to read ALL of the file into memory? vs only a buffer full at a time?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    suyog53 is offline Member
    Join Date
    Sep 2012
    Location
    Navi Mumbai
    Posts
    30
    Rep Power
    0

    Default Re: How to solve "Heap Space" error...?'

    How are you processing the data? Do you try to read ALL of the file into memory? vs only a buffer full at a time?
    I read the file using BufferedReader.....'

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,572
    Blog Entries
    7
    Rep Power
    21

    Default Re: How to solve "Heap Space" error...?'

    Quote Originally Posted by suyog53 View Post
    I read the file using BufferedReader.....'
    Who cares what you use to read that huge file? Are you trying to store the content of the entire file in memory? If so, that explains the OOM error.

    kind regards,

    Jo
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. How to solve this "Fixtures code" error exception?
    By makerror in forum New To Java
    Replies: 4
    Last Post: 12-02-2009, 02:45 AM
  2. Replies: 10
    Last Post: 05-11-2009, 11:56 AM
  3. Replies: 3
    Last Post: 04-22-2009, 08:25 PM
  4. Replies: 16
    Last Post: 07-24-2008, 11:45 AM
  5. Replies: 14
    Last Post: 06-12-2008, 08:36 AM

Tags for this Thread

Posting Permissions

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