MIJI - How to use more RAM

fiji
imagej

#1

Hello,

I use Windows 64 bit with Matlab2016b. I’ve downloaded the latest version of FIJI and included the miji.m.

Now I wanted to load a huge 3D-volume into the open ImageJ like this:

Miji
MIJ.createImage(rand(300,300,300))

So first the Miji interfaces starts in Matlab:

Use MIJ.exit to end the session

--------------------------------------------------------------
MIJ 1.3.6-fiji: Matlab to ImageJ Interface
--------------------------------------------------------------
More Info: http://bigwww.epfl.ch/sage/soft/mij/
Help: MIJ.help
JVM> 1.3.6-fiji
JVM> Version: 1.7.0_60
JVM> Total amount of memory: 209408 Kb
JVM> Amount of free memory: 70825 Kb
ImageJ> Version:1.51h
ImageJ> Memory:82MB of 352MB (23%)

But when creating the image I get:

Java exception occurred:
java.lang.OutOfMemoryError: Java heap space
at ij.process.FloatProcessor.<init>(FloatProcessor.java:37)
at MIJ.createImage(MIJ.java:959)
at MIJ.createImage(MIJ.java:724)

How can I increase the RAM for ImageJ within the Miji plugin?

Thx a lot for your help,
Florian


#2

Hi @PhysikerErlangen, welcome to the forum,

You will need to increase the amount of memory available to matlab.
Have you seen matlab’s Java Heap Memory preferences?

In the past, I’ve edited matlab’s java startup options , by putting a file called “java.opts” in my startup folder.
It contains:

-Xmx16g

Good luck,
John


#3

you can change your MATLAB jave heap memery in your matlab perference --> general, then restart your matlab