Wang Liping--android out of memory (OOM) cause

Source: Internet
Author: User

This error is often encountered in developing image video applications.


Android Memory consists of Dalvik and native 2 parts. Dalvik is the Java heap, and the object created here is assigned here,
the native is the memory that is applied through C/S.
Bitmap is assigned in one way (android3.0, the system is assigned by default by Dalvik). Of course, regardless of the way
2 parts plus no more than Android's memory limit on a single program.



1. The memory of a process can consist of 2 parts: Java uses memory, C uses memory, and the two memory must be less than 16M. Or there will be big
The home is familiar with Oom, this is the first kind of oom situation.
2. What's even weirder is this: once the memory is allocated to Java. After this block of memory even after release. Can only be used for Java, this is expected with the Java virtual
The reason that the memory is divided into several blocks for caching is related to the fact that C is not going to use this memory anyway. So suppose Java suddenly takes up a chunk inside
saved, even very quickly released:


The generation of bitmap is allocated through malloc, which occupies the memory of C, mbitmap the original
cause. Because Java uses too much memory, there is too little memory left for C to use.

Wang Liping--android out of memory (OOM) cause

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.