While Using the Data charts in an Android app and when I navigate to that particular fragment where Data charts are implemented for more than 20 times I get Crash as mentioned below.
java.lang.OutOfMemoryError: Failed to allocate a 275212 byte allocation with 234680 free bytes and 229KB until OOMat dalvik.system.VMRuntime.newNonMovableArray(Native Method)at android.graphics.Bitmap.nativeCreate(Native Method)at android.graphics.Bitmap.createBitmap(Bitmap.java:831)at android.graphics.Bitmap.createBitmap(Bitmap.java:808)at android.graphics.Bitmap.createBitmap(Bitmap.java:775)at com.infragistics.controls.ComponentProxy.resizeBitmaps(ComponentProxy.java:156)at com.infragistics.controls.ComponentProxy.doSizeChanged(ComponentProxy.java:134)at com.infragistics.controls.BasePieChartView.onSizeChanged(BasePieChartView.java:88)
How to stop this memory leak ? . Tried with largeHeap as true option in the manifest file, still its crashing.
Any help is much appreciated.
My team and I have done an initial investigation into this OutOfMemoryException that you are reporting when using what appears to be the PieChartView in a native Android application, and I believe we will need more information from you and possibly an isolated sample project that demonstrates this exception that you are seeing.
From your original description and the stack trace included, it appears that this issue is happening with the PieChartView, and it sounds like this pie chart exists in a fragment that you are visiting many times in your application. This leads me to believe that perhaps something about this fragment is not cleaned up or disposed correctly in your application, and in order to see that, I believe we will require the relevant code or a sample project to reproduce the issue. Would it be possible for you to please provide this?
Please let me know if you have any other questions or concerns on this matter.
Thanks for the reply.
Sure I can share the code sample. Is there any link where I can upload the sample code for this.
Just to make it clear, In the fragment which has 3 frame layouts, I am trying to add 3 different pie charts with some data. So loading the charts serially using Async Task, after the completion of one Async Task the next one will load the next chart. This was the basic functionality, after debugging for some time , cleared the frame views in onPause so that when the next time fragment is loaded it will be fresh start with fresh frame layouts I was able to reduce the number of crashes but this still happens after a prolonged navigation.
Please let me know how can i solve this also link to share my code.
There is an option to "insert image/video/file" from the Insert menu when you are typing your reply that you can use to attach a file to your post.