MMU related to physical memory address handling

What happens when physical memory is fully occupied by process and a new process(similar priority) is introduced. How does the Memory Management unit handle the pages(resource) requested by the new and old processes(same priority tasks).

So I mean to ask how swapping of memory done for similar priority process and physical memory is full on the other side. Please explain with an example?

Answers


You should not care about what happenning in that case, and on current Linux deskops & laptops it is an improbable case (because usually the kernel steals page from the filesystem cache).

When a new program is started with the execve(2) syscalls, new memory mappings are set up (as if nearly done by mmap(2)), possibly with copy-on-write mechanism. Once the program is accessing them, the kernel will page-fault and ultimately load the page in physical RAM. It may have to choose which pages should be stealed. If they are dirty, it has to write them to some swap zone (or to some mmap-ed file if the mapping is MAP_SHARED). Otherwise, it just reuses them (and reassign the physical pages).

If all memory resources are used, memory overcommit may happen

The MMU is used by the linux kernel for virtual memory management. Applications see on some virtual address space (look into /proc/ e.g. with cat /proc/self/maps to understand it).

The MMU is doing the virtual to physical address translation and is giving page faults. The kernel is responsible for configuring the MMU (i.e. setting up the virtual address space translation mechanism) and for handling page faults (which are usually invisible to the application -e.g. because the kernel would fetch a page from the disk, the filesystem or the swap area-, except as the SIGSEGV signal which occurs when a "non-existent" page is accessed).

please take time to read all the links given here.


Need Your Help

How to implement draggable tab using Java Swing?

java user-interface swing tabs

How do I implement a draggable tab using Java Swing? Instead of the static JTabbedPane I would like to drag-and-drop a tab to different position to rearrange the tabs.

Xcode upload Imagines

ios objective-c iphone xcode

i will create a new project that it save an image to a server

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.