Board index » jbuilder » TableDataSet OutOfMemoryError

TableDataSet OutOfMemoryError


2004-02-23 04:55:42 PM
jbuilder21
Dear Sir,
I defined a TableDataSet with 2 columns 20000 records, 1 filled, 1 empty.
And then I want to loop and input the empty column, find the memory is
losing and Out of Memory.
String a=null;
String b=null;
for(i=0;i<20000;i++){
tableDataSet1.goToRow(i);
a=tableDataSet1.getString("Name");
b=abc(a);
tableDataSet1.editRow();
tableDataSet1.setString("abc",b);
tableDataSet1.post();
} // end for i
The program use up 10Mb for 50 records! Terrible!!! How Come?
Thank you very much if anyone can help me!
 
 

Re:TableDataSet OutOfMemoryError

In < XXXX@XXXXX.COM >wongshingyung wrote:
Quote
Dear Sir,
I defined a TableDataSet with 2 columns 20000 records, 1 filled, 1
empty. And then I want to loop and input the empty column, find the
memory is losing and Out of Memory.

String a=null;
String b=null;
for(i=0;i<20000;i++){
tableDataSet1.goToRow(i);
a=tableDataSet1.getString("Name");
b=abc(a);
tableDataSet1.editRow();
tableDataSet1.setString("abc",b);
tableDataSet1.post();
} } // end for i

The program use up 10Mb for 50 records! Terrible!!! How Come?

Try this instead..
while (tableDataSet1.inBounds()){
tableDataSet1.editRow();
tableDataSet1.setString("abc",
abc(tableDataSet1.getString("Name")));
tableDataSet1.post();
tableDataSet1.next();
} } // end for i
Also what does method abc(..) do..?? It could be creating a lot of
objects and not cleaning up.. This could be filling memory..
John..
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/papers.html
====================================================