Hi,

The past weeks I’ve been stumped trying to track down a severe memory
leak which prevents releasing 1481.

I have a hard time tracking down where and why exactly it happens,
therefore I’d be very grateful for your help.

The following shows how to reproduce the problem on GNU/Linux: Getting
Freenet 1481 to crash with an Out-of-Memory error within less than 30
minutes. The gist is: Upload a file.

tee freenet-1481-OOM-reproduction.sh << EOF

wget 
https://github.com/freenet/fred/releases/download/build01481/new_installer_offline_1481.jar
java -jar new_installer_offline_1481.jar
# click through the setup wizard and the in-browser first-run wizard, give 
Freenet high upload bandwidth (i.e. 164kiB/s)

# give freenet time to start the FCP server
sleep 180

# prepare a file to upload
INSERTFILE="$(mktemp /tmp/insert.temp.XXXXXXXXXX)"
head -c 100M < /dev/urandom > "$INSERTFILE"
IDENT=testupload"${INSERTFILE##*.}"

# prepare the command to connect to freenet and upload the file
# connect with HELLO
TEMPFILE="$(mktemp /tmp/insert.temp.XXXXXXXXXX)"
echo ClientHello > $TEMPFILE
echo "Name=Upload-Test${INSERTFILE##*.}" >> $TEMPFILE
echo ExpectedVersion=2 >> $TEMPFILE
echo End >> $TEMPFILE
echo >> $TEMPFILE

# upload with ClientPut
echo ClientPut >> $TEMPFILE
echo "DontCompress=true" >> $TEMPFILE
echo "URI=CHK@/testupload" >> $TEMPFILE
echo "Identifier=$IDENT" >> $TEMPFILE
echo MaxRetries=-1 >> $TEMPFILE
echo UploadFrom=direct >> $TEMPFILE
echo DataLength=$(ls -l $INSERTFILE | cut -d " " -f 5) >> $TEMPFILE
echo Persistence=forever >> $TEMPFILE
echo Global=true >> $TEMPFILE
echo End >> $TEMPFILE
cat $INSERTFILE >> $TEMPFILE

# run the insert
(cat $TEMPFILE | nc 127.0.0.1 9481) &

# watch how long the node lives
for i in {1..100}; do curl 'http://127.0.0.1:8888/stats/?fproxyAdvancedMode=2' 
2>/dev/null | grep -io nodeUptimeSession.*'<' | grep -io '[^;]*s<' | grep -io 
'.*s' ; curl 'http://127.0.0.1:8888/stats/?fproxyAdvancedMode=2' 2>/dev/null | 
grep -io '[^>]* java memory.*&' | grep -io '[^&]*'; sleep 5; done

EOF

I hope this allows you to reproduce the problem — and I would be very
happy if you could find and fix the source of the problem! This has been
blocking the release of 1481 for far too long.

With 33 peers as target (but only up to 25 actually connected, my
connection isn’t that fast), this gets Freenet to die with an OOM within
less than 15 minutes (last successful stats site at 14m17s).

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken

Attachment: signature.asc
Description: PGP signature

Reply via email to