Re: OutOfMemoryError
Posted by
Wayne Rasband-2 on
Dec 25, 2020; 9:08pm
URL: http://imagej.273.s1.nabble.com/OutOfMemoryError-tp5024312p5024315.html
> On Dec 25, 2020, at 6:46 AM, Thomas Fischer <
[hidden email]> wrote:
>
> Hi altogether,
>
> my laptop runs under linux debian 10 and has 8 GB RAM. Edit › Options ›
> Memory & Threads does not allow me to increase the value above 2666MB.
Try the Linux version of ImageJ available at
https://imagej.nih.gov/ij/download.html. The Edit>Options>Memory & Threads command updates the third line of the ImageJ.cfg file. For example, it changes this line to "-Xmx4000m -cp ij.jar ij.ImageJ” when you set the value to 4000 in the Memory & Threads dialog.
-wayne
> relevant lines in /usr/bin/imagej (a not so simple wrapper script used to
> run ImageJ) are
>
> declare -i mem
> declare -i default_mem=4000
> declare -i min_mem=16
> declare -i max_mem
> declare -i free_mem
>
> and further down
>
> elif [[ `uname` == 'Linux' ]] ; then
> if [[ `uname -m` == 'x86_64' ]] ; then
> java_path="${ij_path}/jre64/bin/java"
> max_mem=`free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem < 4000)
> {print fmem} else {print 4000}}'`
> free_mem=`free | awk 'NR == 3 {fmem=int($4 / 1024); if (fmem <
> 4000) {print fmem} else {print 4000}}'`
> mem=${free_mem}/3*2
> if (( $mem > $default_mem || $mem < $min_mem )) ; then
> mem=$default_mem ; fi
> else
>
> typing free:
> total used free shared buff/cache
> available
> Mem: 8064332 1579956 2659136 183288 3825240
> 5998348
> Swap: 8282108 0 8282108
>
> changing declare -i default_mem=4000 to declare -i default_mem=8000 has no
> effect on the lines further down
>
> where is the superior position where the change to 8000 makes a difference
> in the file imagej?
>
> thank you, Thomas
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html