JAudioTagger2.2.3 OOM when i use it many songs info (about 1300) background

56 views Asked by At

io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.OutOfMemoryError: Failed to allocate a 235800 byte allocation with 135032 free bytes and 131KB until OOM, max allowed footprint 134217728, growth limit 134217728 at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.OutOfMemoryError: Failed to allocate a 235800 byte allocation with 135032 free bytes and 131KB until OOM, max allowed footprint 134217728, growth limit 134217728 at org.jaudiotagger.tag.datatype.ByteArraySizeTerminated.readByteArray(ByteArraySizeTerminated.java:94) at org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody.read(AbstractID3v2FrameBody.java:181) at org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody.(AbstractID3v2FrameBody.java:81) at org.jaudiotagger.tag.id3.framebody.FrameBodyAPIC.(FrameBodyAPIC.java:149) at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at org.jaudiotagger.tag.id3.AbstractID3v2Frame.readBody(AbstractID3v2Frame.java:272) at org.jaudiotagger.tag.id3.ID3v23Frame.read(ID3v23Frame.java:446) at org.jaudiotagger.tag.id3.ID3v23Frame.(ID3v23Frame.java:280) at org.jaudiotagger.tag.id3.ID3v23Tag.readFrames(ID3v23Tag.java:581) at org.jaudiotagger.tag.id3.ID3v23Tag.read(ID3v23Tag.java:546) at org.jaudiotagger.tag.id3.ID3v23Tag.(ID3v23Tag.java:311) at org.jaudiotagger.audio.mp3.MP3File.readV2Tag(MP3File.java:219) at org.jaudiotagger.audio.mp3.MP3File.(MP3File.java:391) at org.jaudiotagger.audio.mp3.MP3FileReader.read(MP3FileReader.java:39) at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:286) at com.flyaudio.media.music.util.music.SongUtils.getSongInfo(SongUtils.java:63) at com.flyaudio.media.music.util.music.SongUtils.getExternalSongInfo(SongUtils.java:143) at com.flyaudio.media.music.scan.util.ScanDbUtils.analysisExtraData(ScanDbUtils.java:55) at com.flyaudio.media.music.scan.util.ScanDbUtils$1.doInBackground(ScanDbUtils.java:37) at com.flyaudio.lib.async.executor.RxExecutor$BackgroundTask.doInBackground(RxExecutor.java:62) at com.flyaudio.lib.async.executor.RxExecutor$Task$1.subscribe(RxExecutor.java:117) at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40) at io.reactivex.Observable.subscribe(Observable.java:12246) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:764) 

1

There are 1 answers

2
supernova On

You simply ran out of memory (128MB max):

128 Megabytes (MB)  =   134,217,728 Bytes (B)

If you have enough resources, I'd suggest to simply increase the JVM memory to e.g. 1GB max:

java -jar -Xms512M -Xmx1024M jaudiotagger-2.2.3.jar

This increases the Heap Size by passing JVM parameters -Xms (initial heap size) and -Xmx (max heap size)

This should do the job, but there's more parameters if you need to fine tune. See e.g.: Increase heap size in Java