Home > Back-end >  MEMORY LAYOUT IN C
MEMORY LAYOUT IN C

Time:03-08

I am learning about this topic called Memory Layout in C

But memory are of different types like primary memory (ram), secondary memory (like hard disk) or registers I think THE DIAGRAM

So in this diagram (attached here with) which memory is it referring to? Like is it ram, hard-disk or something else ??

CodePudding user response:

On most modern operating systems, it refers to the virtual address space of a process.

Only part of this address space is actually mapped to physical RAM. Most of this address space is probably not mapped at all, and some of it may be stored on secondary storage such as a hard disk, due to memory paging.

CodePudding user response:

Addressable memory always refers to RAM (or flash in case of embedded systems). The picture looks like the memory layout of an executable process in a PC, all of it uploaded in RAM.

You won't be able to directly access HD memory through an address, because it is accessed through an external bus interface and that part is handled by an OS.

My answer here might be helpful: What gets allocated on the stack and the heap?

  • Related