I was studying for a test of OS Fundamentals and this came to my mind. When I declare a global (or static) variable in a C program like:

```
char* msg = "Hello World!\n";    

```

an array of bytes is reserved in the `.data` and the `"Hello World!\n"` string is saved in `.text`, then when the program is loaded to memory and starts to execute, the `msg` var is initialized with the string saved in `.text`. Is this what happens? So, what is the diference between reserving the bytes in `.data` rather than in heap? I know that in `.data` they have a static size but they cold be reserved in the heap too, right? Why are those things separated? Wouldn't it be more efficient to have just the heap, the stack and the code part in the process image rather than more fractions? It can't be because of physical memory being mapped to multiple virtual adresses (multiple instances of notepad for example) because these vars are editable.

Thank you in advance