![]() ![]() However, when you try and do the same read again, it would be faster. ![]() If you read a large file (say 100-200MB) for the first time, The above was for shared libraries per say, similar is also true to file reading as well. Processes, as reading glibc(etc.) again & again from disk would be time consuming. Used resources are kept in cache so that when processes demand, they could be referenced to same memory location. Keeping multiple copies of glibc in the memory, when every process could access same memory location and do the job. Lets say the glibc library is used by almost all processes. This assists the kernel to work properly in a multi-process environment efficiently.Ī lot of memory used by processes are shared. There is concept of "Copy on Write" for memory management, whereby, if your processes actually uses the memory allocated from virtual memory (that is it does some write on the memory), only then it is mapped to physical memory. ![]() However, it is not necessary it is memory mapped (that is mapped to physical memory). The process would be allocated 300MB from the virtual memory, Lets say you have a process which requests for memory (say 300MB - a web browser). Processes are allocated memory from the virtual memory area, so please note, when you see /proc/meminfo, you will see VMalloc* as the virtual memory details. Thereafter, virtual memory is created, whose mapping is done with physical memory using MMU (Memory Management Unit). Starting from down under, Linux would first divide the memory into pages (usually 4K per page on x86_64 system). This is an old post, however, I would still take the liberty of putting up my thoughts here. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |