I need to make more memory available to ImageJ, and this should be a very easy thing to do according to the online documentation - all I need to do is tweak the "run" script:
http://rsb.info.nih.gov/ij/docs/install/linux.html
But where is this "run" script?
It is apparently located in the "ImageJ folder" - but what folder is that? I have "imagej" folders in:
/usr/share/imagej - contains folders "luts", "macros" and "plugins"
/usr/share/doc/imagej - contains documentation files only (as expected!)
Sometimes the simplest things are the most frustrating...
EDIT:
By "run" script the documentation may be referring to /usr/bin/imagej. This file contains:
Code:
############ DEFAULT MEMORY SETTINGS #########################
declare -i default_mem=768
declare -i min_mem=32
declare -i max_32bit=1800 # empirical
declare -i max_64bit=17000000000 # conservative
############ MEMORY ALLOCATION #########################
OS=$(uname)
processor=$(uname -m) # -p doesn't work on debian/ubuntu
declare -i mem
declare -i max_mem
declare -i free_mem
java_home="${java_home:-$JAVA_HOME}"
if [[ "$OS" == 'SunOS' ]] ; then
java_arch='-d64'
JAVA_HOME="${java_home_SunOS:-$java_home}"
max_mem=`vmstat | awk 'BEGIN{maxMem='$max_64bit'} NR == 3 {fmem=int($5 / 1024); if (fmem < maxMem) {print fmem} else {print maxMem}}'`
free_mem="max_mem"
mem=${free_mem}/2
if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=$default_mem ; fi
elif [[ "$OS" == 'Linux' ]] ; then
if [[ "$processor" == 'x86_64' ]] ; then
java_arch='-d64'
JAVA_HOME="${java_home_Linux_x86_64:-$java_home}"
max_mem=`free | awk -v maxMem=$max_64bit 'NR == 2 {fmem=int($2 / 1024); if (fmem < maxMem) {print fmem} else {print maxMem}}'`
free_mem=`free | awk -v maxMem=$max_64bit 'NR == 3 {fmem=int($4 / 1024); if (fmem < maxMem) {print fmem} else {print maxMem}}'`
mem=${free_mem}/3*2
if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=$default_mem ; fi
else
java_arch='-d32'
JAVA_HOME="${java_home_Linux:-$java_home}"
max_mem=`free | awk -v maxMem=$max_32bit 'NR == 2 {fmem=int($2 / 1024); if (fmem < maxMem) {print fmem} else {print maxMem}}'`
free_mem=`free | awk -v maxMem=$max_32bit 'NR == 3 {fmem=int($4 / 1024); if (fmem < maxMem) {print fmem} else {print maxMem}}'`
mem=${free_mem}/3*2
if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=$default_mem ; fi
fi
fi
Although the "default" memory value is set at 768MB, on my computer with 1GB of RAM (running fluxbox so most of this is free) ImageJ is only allocated 266MB. I think I need to get this up to 500MB or so. I am running 32 bit Ubuntu.
- Should I be editing this "imagej" script, or another file?
- How should I edit it?
Bookmarks