简体   繁体   中英

Java heap size error on android app

I am getting "Java heap size" error when trying to run my app in eclispe.

For Java applications i know how to set the jvm "-Xms512M -Xmx1524M" args, but how do i do this for Android app?

There is no "arguments" tab for android app.

There is one option you can use in manifest. Add android:largeHeap="true" in you manifest. But it is available in some higher APIs if I am not wrong it is available in 3.0+. Other things you can do is to never let your app goes out of memory by allocating and deallocating memory with care.

What you can try is to use the android:largeHeap="true" like Khawar Raza said. Aswell try to nullify(set objects to null) objects that you dont need anymore so they will be deleted by the garbage Collector.

Hope it will work out

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM