Login  Register

increasing memory allocation via Java code

Posted by Roy Wollman on Oct 31, 2009; 1:47am
URL: http://imagej.273.s1.nabble.com/increasing-memory-allocation-via-Java-code-tp3689982.html

Hi All,

I'm trying to import few of the ImageJ classes to use within matlab.
Matlab has great java support which basically means that I can create
objects on the command line (e.g. stk=imp.createEmptyStack();).

However, the maximal memory allocation is too low. Since I'm running
on a OS-X with 64-bit and lots of memory I want to increase the
maximal memory allocation. I already don't so in the standalone
ImageJ64 application and it works great.

Here is the matlab code I'm using:

javaaddpath /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar
import ij.*;
mem=ij.plugin.Memory;
mem.run('');

Than I get the menu in which I change the total memory but.... I get
the following message:

ImageJ is unable to change the memory limit. For
more information, refer to the installation notes at

    http://rsb.info.nih.gov/ij/docs/install/

The ImageJ application (ImageJ.app) was not found.

Current limit: 189MB

Since the java objects are created within matlab its not my job to
worry about memory management but matlab's problem. Is there another
way to increase the limit or just disable the memory limit altogether?

Thanks,
Roy