Page 1 of 1

OutOfMemoryError: Java heap space

Posted: 25 Jul 2013, 10:32
by Hullabaloo
When trying to fetch subtitles for a large number of files via Cronjob, I always get an out-of-memory exception from the Java VM.

Is there a way to increase the initial and maximum heap size?

Code: Select all

/volume1/public/filebot.sh -get-missing-subtitles /volume1/video/TV\ Shows/
 -r --lang en --output srt --encoding utf-8 -non-strict
Get [English] subtitles for 1670 files
Looking up subtitles by filehash via OpenSubtitles
Lookup by hash failed: null
Looking up subtitles by filehash via Sublight
Jul 25, 2013 11:27:46 AM net.sourceforge.filebot.mediainfo.MediaInfo <clinit>
WARNING: Failed to preload libzen
Lookup by hash failed: Unable to load 32-bit native library 'mediainfo'
Searching for [..>40 shownames...] at [OpenSubtitles]
OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
	at java.util.ArrayList.<init>(ArrayList.java:132)
	at net.sourceforge.filebot.similarity.Matcher.match(Unknown Source)
	at net.sourceforge.filebot.subtitle.SubtitleUtilities.matchSubtitles(Unknown Source)
	at net.sourceforge.filebot.cli.CmdlineOperations.lookupSubtitleByFileName(Unknown Source)
	at net.sourceforge.filebot.cli.CmdlineOperations.getSubtitles(Unknown Source)
	at net.sourceforge.filebot.cli.CmdlineOperations.getMissingSubtitles(Unknown Source)
	at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
	at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (°_°)

Re: OutOfMemoryError: Java heap space

Posted: 25 Jul 2013, 10:50
by rednoah
In the filebot.sh script you can try setting -Xmx, e.g.

Code: Select all

-Xmx1024m
Maybe a better idea to call a script to deal with larger folders step by step:

Code: Select all

filebot -script fn:suball ...

Re: OutOfMemoryError: Java heap space

Posted: 25 Jul 2013, 15:23
by Hullabaloo
Ah thanks, didn´t notice the script. That works well!

Re: OutOfMemoryError: Java heap space

Posted: 03 Dec 2013, 20:29
by revelous
I'm running into this error, but I'm using filebot's amc script to hardlink files. It's odd in that it seems to hang after it's finished (after the XBMC call) for a minute or two and then runs out of memory. I've reconfigured filebot with -Xmx1024m. Here's the dump (with paths for files excluded to make easier to read):

Code: Select all

[HARDLINK] Rename [...] to [...]
[HARDLINK] Rename [...] to [...]
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Skipped [...] because [...] already exists
Resource not found: http://thetvdb.com/api/58B4AA94C59AD656/series/267459/all/en.xml
Skipped [...] because [...] already exists
Notify XBMC: localhost
Exception in thread "Thread-2" java.lang.OutOfMemoryError: Java heap space
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:203)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:175)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:204)
	at net.sourceforge.filebot.History.importHistory(History.java:193)
	at net.sourceforge.filebot.HistorySpooler.commit(HistorySpooler.java:78)
	at net.sourceforge.filebot.Main$1.run(Main.java:176)
	at java.lang.Thread.run(Thread.java:724)
I'm running v3.8. Thanks for any suggestions/assistance.

Re: OutOfMemoryError: Java heap space

Posted: 04 Dec 2013, 02:14
by rednoah
How big is your history file?

And why is most of the files being skipped? Are you running it on the same files over and over without excluding files that have already been processed????

Re: OutOfMemoryError: Java heap space

Posted: 19 Feb 2016, 14:16
by tudor131313
rednoah wrote:In the filebot.sh script you can try setting -Xmx, e.g.

Code: Select all

-Xmx1024m
Maybe a better idea to call a script to deal with larger folders step by step:

Code: Select all

filebot -script fn:suball ...
Can you please detail the 'filebot -script fn:suball ...' and where exactly in the script to put it? Something of a little copy-paste perhaps? if it is not too much to ask

Also, can this script be called to deal with large folder renaming step by step?