Error : java.lang.OutOfMemoryError: Java heap space

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
ward0
Posts: 14
Joined: 09 Apr 2016, 10:58

Error : java.lang.OutOfMemoryError: Java heap space

Post by ward0 »

DSM5

Filebot Node 0.1.8, didn't have problems in 0.1.7

Code: Select all

Locking /volume1/@appstore/filebot-node/filebot.log
Fetch subtitles for [/volume1/MOVIES/COUCH/London.Has.Fallen.2016.720p.BluRay.x264-DRONES[rarbg]]
Get [Dutch] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
Looking up subtitles by name via OpenSubtitles
Java heap space
java.lang.OutOfMemoryError: Java heap space
	at net.filebot.web.Movie.toString(Movie.java:111)
	at net.filebot.web.Movie.getEffectiveNames(Movie.java:68)
	at net.filebot.web.SubtitleSearchResult.getEffectiveNames(SubtitleSearchResult.java:59)
	at net.filebot.WebServices$OpenSubtitlesClientWithLocalSearch$$Lambda$137/32347920.apply(Unknown Source)
	at net.filebot.web.LocalSearch.<init>(LocalSearch.java:37)
	at net.filebot.WebServices$OpenSubtitlesClientWithLocalSearch.lambda$new$0(WebServices.java:162)
	at net.filebot.WebServices$OpenSubtitlesClientWithLocalSearch$$Lambda$92/31259367.get(Unknown Source)
	at net.filebot.MemoizedResource.get(Resource.java:36)
	at net.filebot.MemoizedResource.get(Resource.java:36)
	at net.filebot.WebServices$OpenSubtitlesClientWithLocalSearch.search(WebServices.java:167)
	at net.filebot.subtitle.SubtitleUtilities.findProbableSearchResults(SubtitleUtilities.java:257)
	at net.filebot.subtitle.SubtitleUtilities.findSubtitlesByName(SubtitleUtilities.java:146)
	at net.filebot.cli.CmdlineOperations.getSubtitles(CmdlineOperations.java:721)
	at net.filebot.cli.CmdlineOperations.getMissingSubtitles(CmdlineOperations.java:799)
	at net.filebot.cli.ScriptShellBaseClass.getMissingSubtitles(ScriptShellBaseClass.java:366)
Failure (°_°)
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Error : java.lang.OutOfMemoryError: Java heap space

Post by rednoah »

1.
filebot running out of memory has nothing to do with FileBot Node. ;)


2.
Depending on your device, you may need to force -Xmx to something more than the default if your device has very little memory.

e.g.

Code: Select all

export JAVA_OPTS=-Xmx256m

Newer versions of FileBot Node do this automatically for each filebot call:
https://github.com/filebot/filebot-node ... y/task#L11
:idea: Please read the FAQ and How to Request Help.
ward0
Posts: 14
Joined: 09 Apr 2016, 10:58

Re: Error : java.lang.OutOfMemoryError: Java heap space

Post by ward0 »

rednoah wrote:1.
filebot running out of memory has nothing to do with FileBot Node. ;)


2.
Depending on your device, you may need to force -Xmx to something more than the default if your device has very little memory.

e.g.

Code: Select all

export JAVA_OPTS=-Xmx256m

Newer versions of FileBot Node do this automatically for each filebot call:
https://github.com/filebot/filebot-node ... y/task#L11
The problem is that i can't install a clean filebot node 0.2.0 , manual install 0.1.7 works. I guess its because i'm still on DSM5 instead of DSM6.

This is my filebot.sh :

Code: Select all

#!/bin/sh
PRG="$0"

# resolve relative symlinks
while [ -h "$PRG" ] ; do
	ls=`ls -ld "$PRG"`
	link=`expr "$ls" : '.*-> \(.*\)$'`
	if expr "$link" : '/.*' > /dev/null; then
		PRG="$link"
	else
		PRG="`dirname "$PRG"`/$link"
	fi
done

# get canonical path
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd`

# restore original working dir (which may be /root and yield permission denied)
if [ -x "$WORKING_DIR" ]; then
	cd "$WORKING_DIR"
else
	cd "/volume1"
fi


# make sure required environment variables are set
if [ -z "$USER" ]; then
	export USER=`whoami`
fi

# force JVM language and encoding settings
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"

# add 3rd party packages to the library path by default
SYNO_FPCALC="/usr/local/chromaprint/bin/fpcalc"
SYNO_LIBRARY_PATH="/usr/local/mediainfo/lib:/usr/local/chromaprint/lib"

# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SYNO_LIBRARY_PATH:$APP_ROOT"
else
	export LD_LIBRARY_PATH="$SYNO_LIBRARY_PATH:$APP_ROOT"
fi

# choose extractor
EXTRACTOR="ApacheVFS"					# use Apache Commons VFS2 with junrar plugin
# EXTRACTOR="SevenZipExecutable"		# use the 7z executable
# EXTRACTOR="SevenZipNativeBindings"	# use the lib7-Zip-JBinding.so native library

# select application data folder
APP_DATA="$APP_ROOT/data/$USER"

# start filebot
java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Djava.net.useSystemProxies=true -Djna.nosys=true -Dapplication.deployment=spk -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Dnet.filebot.AcoustID.fpcalc="$SYNO_FPCALC" -Dapplication.dir="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/temp" -Duser.home="$APP_DATA" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" $JAVA_OPTS -jar "$APP_ROOT/FileBot.jar" "$@"
Where can i add the line :

Code: Select all

export JAVA_OPTS=`free | awk -vm=1024 -vp=0.7 '/Mem:/ {printf "-Xmx%dm", ($2*p)/m; exit}'`    # set -Xmx to 0.7 of physical memory 
pls.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Error : java.lang.OutOfMemoryError: Java heap space

Post by rednoah »

Virtually anywhere. :lol:
:idea: Please read the FAQ and How to Request Help.
ward0
Posts: 14
Joined: 09 Apr 2016, 10:58

Re: Error : java.lang.OutOfMemoryError: Java heap space

Post by ward0 »

rednoah wrote:Virtually anywhere. :lol:
Does my config looks like a recent one?
ward0
Posts: 14
Joined: 09 Apr 2016, 10:58

Re: Error : java.lang.OutOfMemoryError: Java heap space

Post by ward0 »

rednoah wrote:Virtually anywhere. :lol:
You sir are a hero!
Post Reply