out of Memory error

At one point in my program, I performing calculations on number of rows(~600,000) from a Flat file of 55Mb. I use JSP & JAVA. Here are some things I noticed.

1. It's very slow! :-)

2. Initially, the cpu monitor shows a high level of cpu utilisation, but this slowly drops off with a blip every second or so. Basically, things slow down as the process chugs along.

3. I eventually get a java.Lang.OutOfMemory exception after approx 1:00 -1:30 hrs.

I tried running the JVM with heap size set to 256 Mbytes. I still get the outof mem error.

Is there a faster/better way? Any ideas on how I can get rid of the out of mem errors.....?

I tried searching in the forum for similar kind of discussions but..could n't get the solution for it..Pls help...!!!

[810 byte] By [briskrook] at [2007-9-26 14:22:45]
# 1
try using System.gc(); to force the VM to do a garbage collection every 10.000 records or so.this might work...
trmaUK at 2007-7-2 16:02:48 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 2
Hey did u get rid of ur problem? im getting hte same problem as im reading different DBs through my java program containing 100,000 records. pls help me if u get the solutionthanks,Sachin
sachindere at 2007-7-2 16:02:48 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 3
Have you set the Max Heap size as 256 MB? Just you check that.I got Same Prob , i was setjava -Xms=18m -Xmx=256m .After After that i didn't get Out of Memory Error
kessav@gmail.com at 2007-7-2 16:02:48 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 4
Hi you can not forced garbage collection in java.By the help of System.gc() , you can request to JVM for garbage collection.
gk_gt@yahoo.com at 2007-7-2 16:02:48 > top of Java-index,Other Topics,Java Community Process (JCP) Program...
# 5

hi,

facing the same problem. the only solution is increase the ram size.

if your ram size is 512 and your other processes like application server or web server is running in same machine, its hard to load jsp. other apps might occupy the ram space.

it wont allow the browser to take enough ram memory to load the huge no of records.

run ur servers in your machine (set catlina.bat set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m) and access it from some other machince.

i got my 47000 records in jsp like this.

born4java at 2007-7-2 16:02:48 > top of Java-index,Other Topics,Java Community Process (JCP) Program...