Hi, my first post here
I have been learning ImageJ and Fiji for about a month and have been using them on a number of Windows and Linux computers. I recently installed it on a Raspberry Pi 4 (4gb) for use with the Raspberry Pi HQ camera. I am not very good with code so this would have been impossible for me without the contributions of this forum…so thanks! I am using the ImageJ.sh script to launch ImageJ. I am not using the headless option for now, but may attempt it soon.
I recently ran into the Out of Memory Error while trying to run the FFT Bandpass Filter on one of the HQ camera images, and it took me a day to figure out how to get this working, so here I am sharing what I learned (which could be the wrong for all I know).
Here is the error message:
Out of memory
All available memory (247MB) has been
used. To make more available, use the
Edit>Options>Memory & Threads command.
I tried to increase to 512m and 1024m through the Memory & Threads option, but after each restart and re-attempt the memory error still occurred. I did check the status bar, which indicated that the available memory had actually increased, but the error still persisted. I read more and discovered the problem was related to the Java heap size.
Out of Memory Error troubleshooting here:
https://imagej.net/Troubleshooting
This lead me down the path of trying to understand what variable needed to be added and where. Ultimately I found the -Xms and -Xmx variables control the minimum and maximum Java heap size and they needed to be added to the ImageJ.sh script used to launch on ImageJ on Raspberry Pi.
I added these two lines to below the "eval java $EXT_OPTION " line in the ImageJ.sh script near the bottom.
-Xms256m \
-Xmx1024m \
Restarted and my images now process without the error. I read that there may be an option to launch ImageJ with the -Xmx argument form CLI, but I could not figure that one out. Disclaimer, I have little to no idea what I am doing and hope somebody points out my terrible mistakes if I have made some