[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running out of memory error



Hi Howard,

> I'm writing a java application using NetCDF Java interface, and I get this
> java.lang.OutofMemoryError. The size of array is little over 6 million, and
> it's a floating point array. Is there remedy for this? Thank you very much.

You could specify a higher value for the maximum size of the JVM memory
allocation pool, via the -Xmx option to the java command.  The default
is 16 Mbytes, and 6 million floats would require at least 24 Mbytes.

Alternatively, if you don't need all 6 million floats in memory at the
same time, you could exploit netCDF's direct access capabilities to
just access the subset of data you need when you need it.

Finally, if you suspect some kind of unnecessary object retention, you
might also want to look at the freely-available Java Heap Analysis
Tool 1.03 (HAT) available from

 http://developer.javasoft.com/developer/earlyAccess/hat/index.html 

to analyze the -Xhprof files that are generated by JDK 1.2.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu