Android error: Out of memory on a xxxxx-byte allocation solution

Source: Internet
Author: User

A memory overflow occurred that could be caused by the android:background= "" in the XML of the layout file using the picture background PNG as the background, The background picture is set to a Drawable object. The memory occupied by the Drawable object is divided into two parts of the Java layer and the underlying. Java layer of memory, if your background image calls drawable Setcallback (null) When your view is released, That is, to cancel your background image in the VM reference, the Java part of the memory space, when the system calls the GC function can be recycled. However, in the native layer of memory, the GC is not released. This will result in a memory leak. Use a solid color without a background map, and it won't.

Of course, if you are not due to the memory leak caused by setting background in the XML file,

http://blog.csdn.net/xuhui_7810/article/details/9493681

http://zwkufo.blog.163.com/blog/static/2588251201312864034812/

Http://www.eoeandroid.com/thread-187029-1-1.html

http://blog.csdn.net/scry5566/article/details/8871759

The answers to these bloggers may be helpful to you.

Android error: Out of memory on a xxxxx-byte allocation solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.