[Insight-users] Memory Allocation Error in Java
Luis Ibanez
luis.ibanez at kitware.com
Tue Dec 14 20:11:28 EST 2004
Hi Evert,
The Java virtual machine has a natural limitation to the amount
of memory made available its processes.
http://java.sun.com/docs/hotspot/gc5.0/ergo5.html
You may want to first attempt to increase the memory made available
to your program by the virtual machine.
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/java.html
This can be done with the command line options for the "java"
command:
" -Xmsn
Specify the initial size, in bytes, of the memory allocation pool.
This value must be a multiple of 1024 greater than 1MB. Append the
letter k or K to indicate kilobytes, or m or M to indicate megabytes.
The default value is 2MB. Examples:
-Xms6291456
-Xms6144k
-Xms6m
-Xmxn
Specify the maximum size, in bytes, of the memory allocation pool.
This value must a multiple of 1024 greater than 2MB. Append the letter k
or K to indicate kilobytes, or m or M to indicate megabytes. The default
value is 64MB. Examples:
-Xmx83886080
-Xmx81920k
-Xmx80m
"
If you still find memory allocation problems, you may want to add a
message to the file:
Insight/Code/Common/itkImportImageContainer.txx
in line 186 in order to specify how much memory is trying to allocate.
It is likely that some of the signed/unsigned convertions from Java to
C++ is creating a situation where an obscene amount of memory is being
requested for an image.
Please let us know what you find.
Thanks
Luis
------------------------
Evert van Velsen wrote:
> Hi there,
>
> when running my java-written ITK program, which I've combined with ImageJ,
> I received the following error:
> Error: java.lang.RuntimeException:
> c:\insighttoolkit-1.8.1\code\common\itkImportImageContainer.txx:186:Failed
> to allocate memory for image.
>
> The input of the program is a 200 slice 3d-image (tiff-format) of 128x128,
> and the error occured when performing the ShapeDetectionLevelSetFilter
> with 200 seedpoints (one on each slice).
> I'm using ITK 1.8.1 with java 1.4.2_05
>
> Does anyone know how I can fix this problem?
>
> Thanks,
>
> Evert
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list