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

Memory usage #32

Closed
BraunreutherA opened this Issue Nov 1, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@BraunreutherA

BraunreutherA commented Nov 1, 2016

Hi I don't know why but it seams that the library adds a huge amount of memory usage. As soon as I changed to the CompositeActivity the memory usage increased by 80mb.
I'm not very experienced with the memory analytics tool of android studio but I try to figure out what's the problem. If you're interested I can share you more details private.

Best
Alex

@passsy

This comment has been minimized.

Show comment
Hide comment
@passsy

passsy Nov 2, 2016

Owner

Every method call on Activity creates a anonymous class internally. getApplicationInfo() and getResources() are called multiple thousands times when an Activity starts, creating multiple thousands inner classes. Garbage collection should have no problem with those objects. At least on ART it shouldn't be one. If you experience something different, it's a real problem.

I'm already addressing this "problem" in #24 and it should increase the overall memory consumption once merged.

Owner

passsy commented Nov 2, 2016

Every method call on Activity creates a anonymous class internally. getApplicationInfo() and getResources() are called multiple thousands times when an Activity starts, creating multiple thousands inner classes. Garbage collection should have no problem with those objects. At least on ART it shouldn't be one. If you experience something different, it's a real problem.

I'm already addressing this "problem" in #24 and it should increase the overall memory consumption once merged.

@BraunreutherA

This comment has been minimized.

Show comment
Hide comment
@BraunreutherA

BraunreutherA Nov 2, 2016

I get the following error:

E/AndroidRuntime: Error reporting crash
                  java.lang.OutOfMemoryError: Failed to allocate a 46569656 byte allocation with 16777216 free bytes and 24MB until OOM
                      at java.lang.StringFactory.newStringFromChars(Native Method)
                      at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:629)
                      at java.lang.StringBuilder.toString(StringBuilder.java:663)
                      at com.android.internal.os.RuntimeInit.Clog_e(RuntimeInit.java:67)
                      at com.android.internal.os.RuntimeInit.access$200(RuntimeInit.java:51)
                      at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:93)
                      at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
                      at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)

I'm using a lot of images and videos in my app as it's an video player per se. I don't know if the problem is due to my code or the lib, but it just doesn't work as long as I'm using the CompositeActivity

BraunreutherA commented Nov 2, 2016

I get the following error:

E/AndroidRuntime: Error reporting crash
                  java.lang.OutOfMemoryError: Failed to allocate a 46569656 byte allocation with 16777216 free bytes and 24MB until OOM
                      at java.lang.StringFactory.newStringFromChars(Native Method)
                      at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:629)
                      at java.lang.StringBuilder.toString(StringBuilder.java:663)
                      at com.android.internal.os.RuntimeInit.Clog_e(RuntimeInit.java:67)
                      at com.android.internal.os.RuntimeInit.access$200(RuntimeInit.java:51)
                      at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:93)
                      at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
                      at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)

I'm using a lot of images and videos in my app as it's an video player per se. I don't know if the problem is due to my code or the lib, but it just doesn't work as long as I'm using the CompositeActivity

@BraunreutherA

This comment has been minimized.

Show comment
Hide comment
@BraunreutherA

BraunreutherA Nov 2, 2016

The problem seams to be in the mosby plugin I wrote. As soon as I disabled it the memory usage goes back to normal and the error disappears.
I will investigate further and report back.

BraunreutherA commented Nov 2, 2016

The problem seams to be in the mosby plugin I wrote. As soon as I disabled it the memory usage goes back to normal and the error disappears.
I will investigate further and report back.

@BraunreutherA

This comment has been minimized.

Show comment
Hide comment
@BraunreutherA

BraunreutherA Nov 2, 2016

Okay, it was a problem with the mosby plugin. I failed with the onRetainCustomConfigurationInstance()now it works.

BraunreutherA commented Nov 2, 2016

Okay, it was a problem with the mosby plugin. I failed with the onRetainCustomConfigurationInstance()now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment