Some tuning for Linux


This is not as critical as it used to be with older Linux and JVM versions, but
MALLOC_ARENA_MAX will make memory allocations somewhat less aggressive which can prevent some swapping, especially for heavy Snark users. The following script for i2p startup also prioritizes garbage collection on the system saving some context switching during GC when the router is stalled anyway. Finally it outputs the process ID of the java process which is the one you will want for any diagnostics.

#!/bin/bash
export MALLOC_ARENA_MAX=2 # set to 1 for 32 bit
./i2prouter start
sleep 5
while read pid _
do
    sudo renice -20 $pid &> /dev/null
done < <(ps hH -e -o 'tid comm' | grep "GC Th")
javapid=$(pgrep -f i2ptunnel)
echo $javapid

<-- Back