An analysis of Android Dalvik Heap

Source: Internet
Author: User
<span id="Label3"></p><p><p>http://blog.csdn.net/cqupt_chen/article/details/11068129</p></p><p><p>-dalvik.vm.heapstartsize<br>The initial size of the heap allocation, adjusting this value can affect the smoothness of the application and the overall RAM Consumption. The smaller the value, the slower the system RAM consumes,<br>however, due to the small initial value, some larger applications need to expand the heap, which raises the policy of GC and heap tuning, and the response is slower to apply.<br>instead, the larger the value, the faster the system RAM consumes, but the smoother the Program.<br>-dalvik.vm.heapgrowthlimit<br>The DVM heap is an increase in the limit heap under controlled conditions (only for the Dalvik heap, not including the native heap), but under normal circumstances<br>The size of the DVM heap is no more than the value of Dalvik.vm.heapgrowthlimit (not normally described below). This value controls the<br>The limit heap size of some controlled applications, if the controlled application DVM heap size exceeds this value, an oom (out of Memory) is Raised.<br>-dalvik.vm.heapsize<br>The limit heap size is not controlled, this is the maximum value of the HEAP. Whether it is controlled or not. This value affects the Dalvik of non-controlled Applications.<br>Heap Size. Once the Dalvik heap size exceeds this value, oom is raised directly.</p></p><p>Use the relationship between them to make a simple analogy: allocate Dalvik heap like to go to the cafeteria to play rice, someone appetite big, eat three bowls, some eat small, even a bowl can not Finish. If the canteen according to three bowls of standard to everyone, that is absolutely wasteful, so the strategy of the canteen is to play a bowl, eat, not enough to add their own, set the size of the heap is the same, first give a reasonable value, make use of, not enough to follow the System. After all, the canteen is a business, if many people obviously eat so much, just a bowl followed by a bowl. In order to stop this unreasonable phenomenon, the canteen set up a strategy, the average person can only eat three bowls. But if the hunky really need, can eat five bowls, more than five bowls will not give (too loss).<br>Start giving a bowl of correspondence dalvik.vm.heapstartsize<br>The average person eats up to three bowls corresponding dalvik.vm.heapgrowthlimit<br>Hunky can eat up to five bowls of dalvik.vm.heapsize<br>In Android development, if you want to use a large heap. You need to specify Android:largeheap as true in Manifest. This makes the DVM heap up to Dalvik.vm.heapsize.</p><p><p>(turn) Android Dalvik Heap Analysis</p></p></span>

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.