Java section in profiler consuming lot of memory on simple navigation. This results in an application crash. Any help would be very appreciated.
Asked
Active
Viewed 35 times
0
-
`application crash.` with an exception and stacktrace, which will show where the problem is. – Vladyslav Matviienko Dec 05 '18 at 07:47
-
i am getting this error: java.lang.OutOfMemoryError: Failed to allocate a 39137548 byte allocation with 10959848 free bytes and 10MB until OOM – manpreet kaur Dec 05 '18 at 07:49
-
and the stacktrace? – Vladyslav Matviienko Dec 05 '18 at 07:50
-
1Possible duplicate of [Android OutOfMemoryError:?](https://stackoverflow.com/questions/21012006/android-outofmemoryerror) – Vladyslav Matviienko Dec 05 '18 at 07:51
-
Are you using any high resolution image in your app? – Piyush Dec 05 '18 at 07:51
-
@Piyush yes i am using but am releasing memory on onDestroy. but still getting same issue. – manpreet kaur Dec 05 '18 at 07:54
-
Load your image with Glide because if you are loading image from drawable folder and if it's a high resolution image then it will throw above error. – Piyush Dec 05 '18 at 07:55
-
am using Picasso library. – manpreet kaur Dec 05 '18 at 07:57
-
Show your image. What's the resolution of it? – Piyush Dec 05 '18 at 07:58
1 Answers
0
it looks like you have a "memory leak". Yes, I know that in java garbage collector exist - but it is possible to create a memory leak. Please use Memory Analyzer Tool to find and resolve leaks.

mariopce
- 1,116
- 9
- 17