Results 1 to 3 of 3
  1. #1
    gerard kowara is offline Member
    Join Date
    Oct 2010
    Rep Power

    Default applicaiton error when trying to select/rerieve a lot of data

    Hi All,

    I got this error message "Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space"
    when i'm trying to select/retrieve a total 80000 record from one table

    my code is:
    ResultSet rstx = statement.executeQuery("select * from employee");

    after i'm doing some testing,
    it appears that the class ResultSet only able to receive a total data <=2800 record
    anything beyond that number will make the application crashing

    Is that something related to memory allocated for JVM?
    Any Idea how to fix this problem


  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    Increase the heap space size (and ask yourself whether you really need to hold all of the data in memory). Google "Java Xmx".

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power


    As masijade says, I would say the first question would be "do I actually need every employee?"

    Do you reduce the number of employees retireved, or are you working on all of them when you make this call?

Similar Threads

  1. sql select ,error in your SQL syntax
    By miko5054 in forum JDBC
    Replies: 13
    Last Post: 06-28-2010, 12:48 PM
  2. Replies: 15
    Last Post: 03-25-2010, 03:34 PM
  3. error while retrieving data from data base
    By kirtesh4u in forum New To Java
    Replies: 5
    Last Post: 11-15-2008, 05:10 PM
  4. Replies: 0
    Last Post: 07-07-2008, 08:10 AM
  5. Replies: 0
    Last Post: 01-30-2008, 10:56 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