Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does malloc/new return memory blocks from Cache or RAM?

I wanted to know whether malloc/new returns memory blocks from Cache or RAM.

Thanks in advance.

like image 720
Mahesh Avatar asked Nov 27 '22 23:11

Mahesh


1 Answers

You are abstracted of all that when living as a process in the OS, you only get memory.

You shouldn't worry ever about that, the OS will manage all that for you and the memory unit will move things from one to another. But you still see a single virtual memory layout.

like image 96
Arkaitz Jimenez Avatar answered Dec 15 '22 13:12

Arkaitz Jimenez