3 messages in com.mysql.lists.javaJava.lang.outOfMemoryError on large R...
FromSent OnAttachments
Amit...@Dell.com20 Oct 2004 12:20 
John McCaskey20 Oct 2004 12:37 
Mark Matthews20 Oct 2004 12:44 
Subject:Java.lang.outOfMemoryError on large ResultSet
From:Amit...@Dell.com (Amit@Dell.com)
Date:10/20/2004 12:20:33 PM
List:com.mysql.lists.java

MySQL 5.0 Alpha Jdbc Driver: Connector J OS: Windows 2000 Professional

Table Size 1 Mil. Records.

Table Structure: Table1 logid - autoincrement int(11) Timestamp - timestamp Timestamp2 - timestamp Tag - varchar(15)

Query/Code:

----------- PreparedStatement pst = con.prepareStatement("Select logid,timestamp,Timestamp2,Tag from Table1"); Resultset rs = pst.executeQuery(); //getting java.lang.outOfMemoryError here, even before retrieving the resultset below. While (rs.next()) { //check something, do something...... }

... Tried the same thing above doing it 3 times, with limits of 400k at a time. The first loop goes through fine. 2nd loop which has a limit of 360k-760k again gives out of memory exception.

What shall I do? I have to iterate through all the Mil. Records.. (This is a once-a-week operation).

I have increased Max_Allowed_Packet to 200M , and it still gives the same errors, so I know that's not the problem here.

Please advice.