OutOfMemoryError: Java heap space

Any questions? Need some help?
Post Reply
Hullabaloo
Posts: 12
Joined: 18 Jul 2013, 08:15

OutOfMemoryError: Java heap space

Post 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 (°_°)
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OutOfMemoryError: Java heap space

Post 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 ...
:idea: Please read the FAQ and How to Request Help.
Hullabaloo
Posts: 12
Joined: 18 Jul 2013, 08:15

Re: OutOfMemoryError: Java heap space

Post by Hullabaloo »

Ah thanks, didn´t notice the script. That works well!
revelous
Posts: 1
Joined: 03 Dec 2013, 20:22

Re: OutOfMemoryError: Java heap space

Post 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.
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OutOfMemoryError: Java heap space

Post 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????
:idea: Please read the FAQ and How to Request Help.
tudor131313
Posts: 9
Joined: 18 Feb 2016, 00:16

Re: OutOfMemoryError: Java heap space

Post 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?
Post Reply