PipePipe icon indicating copy to clipboard operation
PipePipe copied to clipboard

[Bug] Out of memory error when using SABR

Open dvg48 opened this issue 5 months ago • 34 comments

Checklist

  • [x] I make sure that the issue is NOT a duplicate of pinned issues
  • [x] I make sure I am using the LATEST version - check here
  • [x] I understand that issues with limited impact, such as those occurring on specific devices or under specific network conditions, will not be fixed
  • [x] I have attached the error report in the issue

Describe the bug

Been dealing with this pretty frequently since updating to 5.2.0 full release (Never happened on any of the betas). Randomly, the app will crash citing "Out of memory" as the error, despite having more than enough memory free. Happens most often when videos start buffering, this time it happened when I plugged in my phone while a video was playing in pop-up mode. Plugged it in and the app instantly crashed.

Version

5.2.0

Frequency

Sometimes (40-60% of the time)

Device

Pixel 9 Pro XL, Android 17 (GrapheneOS)

Steps to reproduce the bug

I am unable to reproduce it consistently as it happens seemingly randomly.

Additional context

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: none
  • Version: 5.2.0
  • OS: Linux Android 17 - 37
Crash log

java.lang.OutOfMemoryError: Failed to allocate a 16 byte allocation with 2290960 free bytes and 2237KB until OOM, target footprint 536870912, growth limit 536870912; giving up on allocation because <1% of heap free after GC.
	at java.lang.Long.valueOf(Long.java:1236)
	at android.compat.Compatibility$ChangeConfig.isForceEnabled(Compatibility.java:286)
	at android.compat.Compatibility$OverrideCallbacks.isChangeEnabled(Compatibility.java:342)
	at android.compat.Compatibility.isChangeEnabled(Compatibility.java:83)
	at android.app.compat.CompatChanges.isChangeEnabled(CompatChanges.java:67)
	at android.os.Looper.isLooperClearsThreadInterruptedEnabled(Looper.java:222)
	at android.os.Looper.loopOnce(Looper.java:297)
	at android.os.Looper.loop(Looper.java:397)
	at android.os.HandlerThread.run(HandlerThread.java:139)


dvg48 avatar Jun 29 '26 07:06 dvg48

have you enabled sabr?

InfinityLoop1308 avatar Jun 29 '26 07:06 InfinityLoop1308

Yes, this started happening after enabling force SABR. Apologies for not including that.

dvg48 avatar Jun 29 '26 07:06 dvg48

Yeah we have noticed the issue, will deal with it soon.

InfinityLoop1308 avatar Jun 29 '26 07:06 InfinityLoop1308

@InfinityLoop1308 I was having this issue while working on it, but I thought it only happened in 4K. @dvg48, do you remember which video you were watching and in what quality, please?

Priveetee avatar Jun 29 '26 07:06 Priveetee

@Priveetee it's 480p for me and can happen on every videos randomly. And I mostly encounter this in background playing a playlist.

InfinityLoop1308 avatar Jun 29 '26 07:06 InfinityLoop1308

https://www.youtube.com/watch?v=IpT7h8VJX-0

720p, as that's my usual default when in pop-up view.

dvg48 avatar Jun 29 '26 07:06 dvg48

@Priveetee it's 480p for me and can happen on every videos randomly. And I mostly encounter this in background playing a playlist.

I think I know what it is, let me handle this I'm free rn

Priveetee avatar Jun 29 '26 07:06 Priveetee

If it changes anything, the video was playing from a playlist

dvg48 avatar Jun 29 '26 07:06 dvg48

I think I have found the damn bug

Priveetee avatar Jun 29 '26 08:06 Priveetee

Hello @dvg48 , please can you try this debug apk and tell me if it's fix the issue ?

here

Priveetee avatar Jun 29 '26 10:06 Priveetee

Will test it over the next day to really see, so far it's gone issue free though

dvg48 avatar Jun 29 '26 14:06 dvg48

Having a hard time getting videos to load on it now tbh. Usually can only get 2-3 minutes in before it gets locked in endless buffering and I've tried on multiple networks

dvg48 avatar Jun 30 '26 02:06 dvg48

It's also possible the slow loading is related to the debug build. Debug versions are much slower than release versions.

InfinityLoop1308 avatar Jun 30 '26 03:06 InfinityLoop1308

At the very least, it does seem like this issue is fixed. Haven't seen it at all on the debug build so far

dvg48 avatar Jun 30 '26 03:06 dvg48

Glad it get fixed. We'll soon release a beta version for better testing.

InfinityLoop1308 avatar Jun 30 '26 04:06 InfinityLoop1308

Ah, nevermind, just crashed again.

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: none
  • Version: 5.2.0
  • OS: Linux Android 17 - 37
Crash log

java.lang.OutOfMemoryError: Failed to allocate a 11193984 byte allocation with 4639200 free bytes and 4530KB until OOM, target footprint 536870912, growth limit 536870912
	at org.schabi.newpipe.extractor.services.youtube.sabr.SabrMediaSegmentCollector$OpenSegment.<init>(SabrMediaSegmentCollector.java:119)
	at org.schabi.newpipe.extractor.services.youtube.sabr.SabrMediaSegmentCollector$OpenSegment.<init>(SabrMediaSegmentCollector.java:0)
	at org.schabi.newpipe.extractor.services.youtube.sabr.SabrMediaSegmentCollector$Incremental.onMediaHeader(SabrMediaSegmentCollector.java:77)
	at org.schabi.newpipe.extractor.services.youtube.sabr.SabrStreamingResponseReader.lambda$read$0(SabrStreamingResponseReader.java:36)
	at org.schabi.newpipe.extractor.services.youtube.sabr.SabrStreamingResponseReader$$ExternalSyntheticLambda0.accept(D8$$SyntheticClass:0)
	at org.schabi.newpipe.extractor.services.youtube.sabr.UmpReader.readStreaming(UmpReader.java:42)
	at org.schabi.newpipe.extractor.services.youtube.sabr.SabrStreamingResponseReader.read(SabrStreamingResponseReader.java:33)
	at org.schabi.newpipe.extractor.services.youtube.sabr.YoutubeSabrProbe.postMediaRequest(YoutubeSabrProbe.java:216)
	at org.schabi.newpipe.extractor.services.youtube.sabr.YoutubeSabrProbe.probeFollowUpMediaResponse(YoutubeSabrProbe.java:173)
	at org.schabi.newpipe.extractor.services.youtube.sabr.YoutubeSabrSession.fetchNextResponse(YoutubeSabrSession.java:186)
	at org.schabi.newpipe.extractor.services.youtube.sabr.YoutubeSabrSession.pumpOnce(YoutubeSabrSession.java:255)
	at org.schabi.newpipe.player.datasource.SabrStreamPump.loop(SabrStreamPump.java:197)
	at org.schabi.newpipe.player.datasource.SabrStreamPump.$r8$lambda$BaJF7pBsxmWm9nHw-T50EqMH9o4(SabrStreamPump.java:0)
	at org.schabi.newpipe.player.datasource.SabrStreamPump$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
	at java.lang.Thread.run(Thread.java:1572)


dvg48 avatar Jun 30 '26 07:06 dvg48

I also tested but haven't met the issue yet, will test more.

InfinityLoop1308 avatar Jun 30 '26 07:06 InfinityLoop1308

Had a video playing in background from a playlist, not even in pop-up view this time. Lasted a lot longer before crashing though

dvg48 avatar Jun 30 '26 07:06 dvg48

OK I will check again np

Priveetee avatar Jun 30 '26 07:06 Priveetee

And can you confirm, @dvg48, that you were using the debug version?

Priveetee avatar Jun 30 '26 07:06 Priveetee