Java.Lang.OutOfMemoryError with 1 million index array

I

Ian Suttle

Hey all. I am having an issue with the java.lang.outofmemoryerror. I
am loading a resultset from SQL 2000 into my console application in
Windows XP. The recordset consists of 1,000,000 rows (all rows in
table) which I convert to an array structure. This was working fine
until I added additional data to the array from the resultset. In
total, the physical table size is 35,840KB. When I monitor the amount
of memory being used via Task Manager, it throws the error at about 75
MB consistently.

I have tried to break up the query into parts of 250,000 thinking that
all of the data from the 1,000,000 rows is too much memory overhead in
addition to storing the data in the arrays. This has the same effect
once I get to about 75MB of Mem Usage.

I have also watched the heap size within JBuilder9, which has an
allocated heap size of 31.8MB. When the error occurs, the utilized
portion of the heap is also around the allocated size. I have tried
running this application within JBuilder and as a compiled EXE.

If anyone has any suggestions as to how to get around whatever
limitations are occurring here, please let me know.

The following are the specs of the test:
Microsoft Windows XP - SP1
P4 - 1.8GHZ
640MB RAM
JDK 1.4.1
JBuilder 9 Enterprise

Thanks in advance!
Ian Suttle
Zing.com
 
I

Ian Suttle

Thank you for the help. It turns out that my whole problem had been
that in JBuilder I was putting the "-mx128m" switch into the
application startup line instead of the VM startup line.

Do you know if there is any way to change the default maximum
allocation to be higher than 64MB?

Thanks again!
Ian Suttle
 
W

Wolfram Rittmeyer

Ian said:
Thank you for the help. It turns out that my whole problem had been
that in JBuilder I was putting the "-mx128m" switch into the
application startup line instead of the VM startup line.

Do you know if there is any way to change the default maximum
allocation to be higher than 64MB?

Thanks again!
Ian Suttle

No, AFAIK there is only the command-line option. But that should be good
enough. Just create a shell-script / batch-file to call your programm,
using any command-line options needed, so you wont have to type it in
over and over again.

Wolfram Rittmeyer
http://www.jsptutorial.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top