Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM in scheduleNextRender #600

Open
mopsalarm opened this issue Oct 15, 2018 · 10 comments
Open

OOM in scheduleNextRender #600

mopsalarm opened this issue Oct 15, 2018 · 10 comments
Labels

Comments

@mopsalarm
Copy link

mopsalarm commented Oct 15, 2018

After updating from 1.2.12 to 1.2.15 I see a lot of OutOfMemoryErrors in GifDrawable.scheduleNextRender. I only see this in firebase over a wide range of Android versions and devices, i could not recreate the issue locally.
In a background thread I am just loading a GifDrawable from a RandomAccessFile.getFD() that I am closing after creating the GifDrawble. On the main thread I am passing the GifDrawable to a ImageView and calling currentFrameIndex and numberOfFrames, as well as pause(), start(), stop() and seekTo(0) once or twice.
20181015-213144
20181015-213157

@koral-- koral-- added the bug label Oct 15, 2018
@koral--
Copy link
Owner

koral-- commented Oct 16, 2018

Thanks for the report, I'll check that.

@koral--
Copy link
Owner

koral-- commented Oct 17, 2018

Those stacktraces originates from framework code. Nothing has changed here between versions 1.2.12 an 1.2.15. Not sure what I can do without steps to reproduce.

I guess that some changes in your project caused memory starvation and it is just revealed here as OOME.
I can only suggest memory profiling: https://developer.android.com/studio/profile/memory-profiler maybe you will be able to find a memory leak.

I'll close this issue due to no known action which can be performed by me. However, it can be reopened if there is some new info.

@koral-- koral-- closed this as completed Oct 17, 2018
@mopsalarm
Copy link
Author

Actually I do think that the issue is somewhere with your library. I switched back and forth between the two versions since 1.2.15 was released and those errors do not appear with 1.2.12 but reappear as soon as I switch to 1.2.15.
I already did some memory profiling but I couldn't make out any issue. I am now also using sampleSize to downscale large gifs but the errors still occur at about the same rate I would say.

@koral--
Copy link
Owner

koral-- commented Oct 17, 2018

OK, I'll to reproduce that.

@koral-- koral-- reopened this Oct 17, 2018
@koral--
Copy link
Owner

koral-- commented Oct 30, 2018

On which Android version did those issues occur?

@mopsalarm
Copy link
Author

It looks like it is only occurring on 6, 7 and 8.

@koral--
Copy link
Owner

koral-- commented Nov 2, 2018

OK, I was able to reproduce it on stress tests. It seems that some filedescriptor is closed more than one time. I'll investigate and fix it asap.

@mopsalarm
Copy link
Author

Great news, thank you very much!

@mopsalarm
Copy link
Author

mopsalarm commented Dec 22, 2018

This issue still persists. I've now updated to 1.2.16 and the issue immediately re-appears in my firebase crashlytics logs.
Could not allocate JNI Env: Failed anonymous mmap(0x0, 8192, 0x3, 0x2, 53, 0): Bad file descriptor. See process maps in the log.
20181222-162522

@koral-- koral-- reopened this Dec 23, 2018
@koral--
Copy link
Owner

koral-- commented Jan 15, 2019

Sorry for the delay. I'll try to reproduce that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants