Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword or section
Like this

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Linux Memory

Linux Memory

|Views: 2,272|Likes:
Published by Nitin Gupta

More info:

Published by: Nitin Gupta on Jan 17, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less





What is Memory Management?
The term
memory management 
refers to the mechanisms implemented by an operating system to provide memory-related services to applications. These services include
virtual memory
(use of ahard disk or other non-RAM storage media to provide additional program memory),
 protected memory
(exclusive access to a region of memory by a process), and
 shared memory
(cooperativeaccess to a region of memory by multiple processes). Linux¶s memory management services are built on a programming foundation that includes a peripheral device called a
 Memory Management Unit (MMU)
. An MMU translates physical memory addresses to
linear addresses
used by the operating system, and requests a
 page fault 
interrupt when the CPU tries to accessmemory that it is not entitled to.
Why do we need it?
Compensation for limited address space
High cost of main memory, lower cost and greater abundance of secondary storage
Static storage evaluation became too difficult...
What does it do?
Allows processes that may not be entirely in memory to execute by means of automatic storageallocation.
Programs logical memory is seperated from physical memory.
Data is swapped between main memory and secondary storage according to some replacementalgorithm (Paging and Segmentation)
Program must only be aware of logical memory space, and the OS may maintain multiplelevels of physical memory space.
Programs are unable to acces the memory allocated to other processes. To be able to do so aspecial request must be made to the OS.
Mapper function must be very fast.
Extra record keeping (Page Table, Interted Page Table)
age Directories and
age Tables:
The fundamental unit of memory under Linux is the
, a nonoverlapping region of contiguous memory. All available physical memory is organized into pages near the end of thekernel¶s boot process, and pages are doled out to and revoked from processes by the kernel¶smemory management algorithms at runtime. Linux uses 4k-byte pages for most processors.Under Linux, each process has an associated
 page directory
 page table
, data structures thatkeeptrack of which memory pages are being used by the process, and what their virtual and physical addresses are. When a process needs more memory, an unused page is taken from aglobal list called pgdata_list, and added to the process¶s page table. When the process exits, its pages are returned to pgdata_list.
Mapping a
When a memory page is given to a process, the page is said to have been
to that process.To map a page to a process, the MMU¶s configuration is adjusted so that the physical address of that page (the number that actually goes out on the processor¶s address lines) is translated to the
address needed by the process. Memory pages are usually scattered around in memory; thelinear-to-physical mapping provided by the MMU makes the pages appear to have contiguousaddresses to the operating system.

Activity (7)

You've already reviewed this. Edit your review.
1 hundred reads
陳正元 liked this
陳正元 liked this
陳正元 liked this
陳正元 liked this
陳正元 liked this
Dhruv Chawda liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->