Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading/Writing Bulk Data, getting OutOfMemoryError: Java heap space

189123Oct 14 2009 — edited Nov 7 2009
Hello,

I am reading more than a million record using CursoredStream, following is my code snippet for reading data
 ReadAllQuery query = new ReadAllQuery();
 query.setReferenceClass(DataBk.class);
 query.useCursoredStream();
 CursoredStream stream;
 stream = (CursoredStream)dbses.executeQuery(query);
       while (!stream.atEnd()) {
       vector1 = stream.read(stream.size());
       }       
Problem is I am getting
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
I was reading other forums posts about this and it is mentioned that memory heap size could be increased.
Where do I increase memory heap size?
2519873

Besides, if my above code is not alright, someone could suggest best approach for reading and writing bulk data.

Regards

Edited by: user20090209 on Oct 14, 2009 10:17 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2009
Added on Oct 14 2009
25 comments
5,044 views