Memoryfile Stealing Android Memory

Source: Internet
Author: User

Reference Link: http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2016/0111/3859.html

New Memoryfile (null, inputstream.available ()); Memoryfile.allowpurging (false= Memoryfile.getoutputstream (); Outputstream.write (1024x768);

The memory allocated by Memoryfile does not occupy Java heap memory and does not even occupy app memory under 4.4 systems. More than 4.4 of the system app memory count is included in the Ashmem memory, including this part.

Memoryfile is a set of frameworks that Android introduced at the very beginning, which actually encapsulates the unique memory-sharing mechanism of Android Ashmem Anonymous shared memory, which simply means that Ashmem is registered as a special character device in the Android kernel, The Ashmem driver initializes a memory area in a custom slab buffer in the kernel, and then maps the requested memory to the user's process space through the mmap (via TMPFS), which allows the memory requested here to be used in the user process, in addition, One of the features of Ashmem is the ability to reclaim memory that is labeled "Unpin" when the system is out of memory, which is described later, and memoryfile can also be used by binder to share a memory area across processes for two processes. Since the entire process of applying for memory is no longer on the Java layer, it is clear that the memory used by the Memoryfile application does not actually consume Java heap memory.

Memoryfile Stealing Android Memory

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.