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

    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

    Thanks

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    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
    Posts
    11,450
    Rep Power
    19

    Default

    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, 11:48 AM
  2. Replies: 15
    Last Post: 03-25-2010, 02:34 PM
  3. error while retrieving data from data base
    By kirtesh4u in forum New To Java
    Replies: 5
    Last Post: 11-15-2008, 04:10 PM
  4. Replies: 0
    Last Post: 07-07-2008, 07:10 AM
  5. Replies: 0
    Last Post: 01-30-2008, 09: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
  •