Page 1 of 1

"OutOfMemoryError" Error scanning MediaCabinet files

PostPosted: Fri Apr 05, 2013 7:19 pm
by destria
Hi,

Well, having gotten MediaCabinet running, I'm now hitting this error when I'm running the "Update Search index Now" process in the MediaCabinet configuration.

Once it hits this error, the progress pauses at about ~50,000 files read for metadata. Any thoughts?

Code: Select all
[2013-04-05 19:56:46] ERROR LibraryScannerService - Unexpected error caught during scanning!
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOf(Arrays.java:2367)
   at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
   at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
   at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
   at java.lang.StringBuilder.append(StringBuilder.java:132)
   at org.jaudiotagger.tag.datatype.TextEncodedStringSizeTerminated.readByteArray(TextEncodedStringSizeTerminated.java:110)
   at org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody.read(AbstractID3v2FrameBody.java:181)
   at org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody.<init>(AbstractID3v2FrameBody.java:81)
   at org.jaudiotagger.tag.id3.framebody.FrameBodyCOMM.<init>(FrameBodyCOMM.java:106)
   at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
   at org.jaudiotagger.tag.id3.AbstractID3v2Frame.readBody(AbstractID3v2Frame.java:214)
   at org.jaudiotagger.tag.id3.ID3v23Frame.read(ID3v23Frame.java:415)
   at org.jaudiotagger.tag.id3.ID3v23Frame.<init>(ID3v23Frame.java:250)
   at org.jaudiotagger.tag.id3.ID3v23Tag.readFrames(ID3v23Tag.java:589)
   at org.jaudiotagger.tag.id3.ID3v23Tag.read(ID3v23Tag.java:556)
   at org.jaudiotagger.tag.id3.ID3v23Tag.<init>(ID3v23Tag.java:303)
   at org.jaudiotagger.audio.mp3.MP3File.readV2Tag(MP3File.java:219)
   at org.jaudiotagger.audio.mp3.MP3File.<init>(MP3File.java:391)
   at org.jaudiotagger.audio.mp3.MP3FileReader.read(MP3FileReader.java:39)
   at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:285)
   at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:148)
   at com.github.hakko.musiccabinet.service.library.AudioTagService.updateMetadata(AudioTagService.java:81)
   at com.github.hakko.musiccabinet.service.library.LibraryMetadataService.receive(LibraryMetadataService.java:41)
   at com.github.hakko.musiccabinet.service.library.LibraryScannerService$1.run(LibraryScannerService.java:135)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:722)

Re: "OutOfMemoryError" Error scanning MediaCabinet files

PostPosted: Sat Apr 06, 2013 8:32 pm
by hakko
This is another thing I could be more clear about.. when you start a Java process, you specify how much memory it's allowed to use. The default is 150MB of RAM (I think) and if the app tries to grab more than that, you'll see this OutOfMemory error.

Now the default is usually fine for normal usage but for a large library, it might need a little more during the initial scanning. Say 256MB maybe?

This is configured in the startup script (subsonic.sh) where it says java -Xmx150m or something like that. 150m means 150MB. If you increase it to something larger, you should be fine.