Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
234 views
in Technique[技术] by (71.8m points)

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

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)?

question from:https://stackoverflow.com/questions/65952247/jaudiotagger2-2-3-oom-when-i-use-it-many-songs-info-about-1300-background

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...