{"action":"closed","issue":{"url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/802","labels_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/802/labels{/name}","comments_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/802/comments","events_url":"https://api.github.com/repos/PhilJay/MPAndroidChart/issues/802/events","html_url":"https://github.com/PhilJay/MPAndroidChart/issues/802","id":90677469,"number":802,"title":"OutOfMemory in the new version 2.1.0","user":{"login":"ciceromsjr","id":3678693,"avatar_url":"https://avatars.githubusercontent.com/u/3678693?v=3","gravatar_id":"","url":"https://api.github.com/users/ciceromsjr","html_url":"https://github.com/ciceromsjr","followers_url":"https://api.github.com/users/ciceromsjr/followers","following_url":"https://api.github.com/users/ciceromsjr/following{/other_user}","gists_url":"https://api.github.com/users/ciceromsjr/gists{/gist_id}","starred_url":"https://api.github.com/users/ciceromsjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciceromsjr/subscriptions","organizations_url":"https://api.github.com/users/ciceromsjr/orgs","repos_url":"https://api.github.com/users/ciceromsjr/repos","events_url":"https://api.github.com/users/ciceromsjr/events{/privacy}","received_events_url":"https://api.github.com/users/ciceromsjr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-24T13:35:41Z","updated_at":"2015-06-24T13:58:04Z","closed_at":"2015-06-24T13:58:04Z","body":"In the new version of this library, I have an OutOfMemory error when I rotate my device.\r\nThe device's model is Galaxy S4 and I am using LineChart to show statistics data.\r\nIf I rotate it about twice I have a crash error.\r\n\r\nI did not have this error in preview version (2.0.9).\r\n\r\nThe error log follow below:\r\n\r\njava.lang.OutOfMemoryError: Failed to allocate a 4688652 byte allocation with 3116164 free bytes and 2MB until OOM\r\n1\tat dalvik.system.VMRuntime.newNonMovableArray(Native Method)\r\n2\tat android.graphics.Bitmap.nativeCreate(Native Method)\r\n3\tat android.graphics.Bitmap.createBitmap(Bitmap.java:939)\r\n4\tat android.graphics.Bitmap.createBitmap(Bitmap.java:912)\r\n5\tat android.graphics.Bitmap.createBitmap(Bitmap.java:879)\r\n6\tat com.github.mikephil.charting.charts.Chart.onSizeChanged(Chart.java:1457)\r\n7\tat android.view.View.sizeChange(View.java:16819)\r\n8\tat android.view.View.setFrame(View.java:16792)\r\n9\tat android.view.View.layout(View.java:16707)\r\n10\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n11\tat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)\r\n12\tat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)\r\n13\tat android.widget.LinearLayout.onLayout(LinearLayout.java:1465)\r\n14\tat android.view.View.layout(View.java:16711)\r\n15\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n16\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n17\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n18\tat android.view.View.layout(View.java:16711)\r\n19\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n20\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n21\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n22\tat android.view.View.layout(View.java:16711)\r\n23\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n24\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n25\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n26\tat android.view.View.layout(View.java:16711)\r\n27\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n28\tat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)\r\n29\tat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)\r\n30\tat android.widget.LinearLayout.onLayout(LinearLayout.java:1465)\r\n31\tat android.view.View.layout(View.java:16711)\r\n32\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n33\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n34\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n35\tat android.widget.ScrollView.onLayout(ScrollView.java:2288)\r\n36\tat android.view.View.layout(View.java:16711)\r\n37\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n38\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n39\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n40\tat android.view.View.layout(View.java:16711)\r\n41\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n42\tat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)\r\n43\tat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)\r\n44\tat android.widget.LinearLayout.onLayout(LinearLayout.java:1465)\r\n45\tat android.view.View.layout(View.java:16711)\r\n46\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n47\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n48\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n49\tat android.view.View.layout(View.java:16711)\r\n50\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n51\tat android.support.v4.view.ViewPager.onLayout(ViewPager.java:1594)\r\n52\tat android.view.View.layout(View.java:16711)\r\n53\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n54\tat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)\r\n55\tat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)\r\n56\tat android.widget.LinearLayout.onLayout(LinearLayout.java:1465)\r\n57\tat android.view.View.layout(View.java:16711)\r\n58\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n59\tat android.widget.RelativeLayout.onLayout(RelativeLayout.java:1077)\r\n60\tat android.view.View.layout(View.java:16711)\r\n61\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n62\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n63\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n64\tat android.view.View.layout(View.java:16711)\r\n65\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n66\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n67\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n68\tat android.view.View.layout(View.java:16711)\r\n69\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n70\tat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)\r\n71\tat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)\r\n72\tat android.widget.LinearLayout.onLayout(LinearLayout.java:1465)\r\n73\tat android.view.View.layout(View.java:16711)\r\n74\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n75\tat android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:890)\r\n76\tat android.view.View.layout(View.java:16711)\r\n77\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n78\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n79\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n80\tat android.view.View.layout(View.java:16711)\r\n81\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n82\tat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)\r\n83\tat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)\r\n84\tat android.widget.LinearLayout.onLayout(LinearLayout.java:1465)\r\n85\tat android.view.View.layout(View.java:16711)\r\n86\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n87\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n88\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n89\tat android.view.View.layout(View.java:16711)\r\n90\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n91\tat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)\r\n92\tat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)\r\n93\tat android.widget.LinearLayout.onLayout(LinearLayout.java:1465)\r\n94\tat android.view.View.layout(View.java:16711)\r\n95\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n96\tat android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)\r\n97\tat android.widget.FrameLayout.onLayout(FrameLayout.java:508)\r\n98\tat android.view.View.layout(View.java:16711)\r\n99\tat android.view.ViewGroup.layout(ViewGroup.java:5328)\r\n100\tat android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2319)\r\n101\tat android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2032)\r\n102\tat android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)\r\n103\tat android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6642)\r\n104\tat android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)\r\n105\tat android.view.Choreographer.doCallbacks(Choreographer.java:590)\r\n106\tat android.view.Choreographer.doFrame(Choreographer.java:560)\r\n107\tat android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)\r\n108\tat android.os.Handler.handleCallback(Handler.java:739)\r\n109\tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n110\tat android.os.Looper.loop(Looper.java:145)\r\n111\tat android.app.ActivityThread.main(ActivityThread.java:5942)\r\n112\tat java.lang.reflect.Method.invoke(Native Method)\r\n113\tat java.lang.reflect.Method.invoke(Method.java:372)\r\n114\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)\r\n115\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)"}}