Posted by
Gabriel Lapointe on
Sep 12, 2008; 6:21pm
URL: http://imagej.273.s1.nabble.com/Linux-download-tp3695105p3695112.html
I tried that on my debian (amd64) server with 4G of ram. but for some
reason unkonwn to me the part about memory detection doesn't work and
I'm stuck with only 500m
Here the part about memory allocation
declare -i mem
declare -i default_mem=500
declare -i min_mem=16
declare -i max_mem
declare -i free_mem
# max memory allocation is 1800MB on 32bit java and 4000 on 64bit java
if [[ `uname` == 'SunOS' ]] ; then
...
elif [[ `uname` == 'Linux' ]] ; then
if [[ `uname -m` == 'x86_64' ]] ; then
arch='-d64'
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
arch='-d32'
java_path="${ij_path}/jre/bin/java"
free_mem=`free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem <
1800) {print fmem} else {print 1800}}'`
free_mem=`free | awk 'NR == 3 {fmem=int($4 / 1024); if (fmem < 1800)
{print fmem} else {print 1800}}'`
mem=${free_mem}/3*2
if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=
$default_mem ; fi
fi
fi
Paolo Ariano wrote:
> Il giorno ven, 12/09/2008 alle 11.47 +0200, Jarek Lipski ha scritto:
>
>> #!/bin/sh
>> SCRIPT_DIR=`dirname $0`
>> java -Xmx512m -jar $SCRIPT_DIR/ij.jar
>>
>
> Hi Jerek,
>
> you could download the .deb from:
>
http://packages.debian.org/unstable/science/imagej>
> and if you want extract the imagej.sh wrapper or better i paste it
> here ;)
>
> hth
> paolo