Memory usage of the process

Source: Internet
Author: User

Vm_stat_account

void Vm_stat_account (struct mm_struct *mm, vm_flags_t flags, long npages)
{
MM->TOTAL_VM + = Npages;

if (is_exec_mapping (Flags))
MM->EXEC_VM + = Npages;
else if (is_stack_mapping (Flags))
MM->STACK_VM + = Npages;
else if (is_data_mapping (Flags))
MM->DATA_VM + = Npages;
}

Initially, these pages are either anonymous or file pages

239/*
240  * Executable code area-executable, not writable, not stack
241  */
242 static inline B Ool is_exec_mapping (vm_flags_t flags)--This is the file page
243 {
244     return (Flags & VM_ EXEC | Vm_write | Vm_stack)) = = Vm_exec;
245}
246
247/*  
248  * Stack area-atomatically grows in one Direction
249  *  
250&nbs P * Vm_growsup/vm_growsdown VMAs is always private anonymous:
251  * DO_MMAP () forbids all other COMBINATIONS.
252  */
253 static inline bool Is_stack_mapping (vm_flags_t Flags)---Anonymous page
254 {
255   & nbsp Return (Flags & vm_stack) = = Vm_stack;
256}
257
258/*
259  * Data area-private, writable, not stack
260  */
261 static inline bool Is_da Ta_mapping (vm_flags_t Flags)---Anonymous page
262 {
263     return (Flags & (Vm_write | vm_shared | Vm_stack)) = = Vm_write;
264}

Memory usage of the process

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.