Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the code memory managed?

When talking about a process' memory, I heard about things like code memory and data memory.

And for the data memory, there are 2 major managing mechanisms, stack and heap.

I am now wondering how is the code memory managed? And who manages it?

Pardon me if my statement is not so clear.

Thanks.

like image 993
smwikipedia Avatar asked Jul 09 '10 08:07

smwikipedia


People also ask

What is code memory management?

It takes control of the system and coordinates computer memory, keeping the RAM usage steady. It assigns memory blocks to various running applications as required by the program. Simply put, memory management manages the memory usage of your computer, and its function helps to optimize the overall system performance.

What causes stop code memory management?

Causes of Stop Code Memory Management Outdated or corrupt drivers. I/O Issues. Damaged system files.

What causes memory management?

A common cause of the MEMORY MANAGEMENT error is a damaged, outdated or incorrect video card driver. And so to fix the error you need to update your video card driver to the most recent correct version. There are two ways to update the driver: manually and automatically.


1 Answers

I recommend http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory (and the other memory related articles) if you're interested in finding out more about the details of process' memory management.

code memory = Text segment

Notice how the address space is 4GB. When the kernel creates a process it gives it virtual memory. Below is an example of a 32 bit OS. The kernel manages what addresses get mapped to actual RAM via the processor's MMU. So, the kernel and the MMU manage code memory, just as they manage the entire address space of a process.

Borrowed from duartes.org
(source: duartes.org)

like image 118
TheJuice Avatar answered Oct 05 '22 02:10

TheJuice