Page 1 of 1

Best memory manager

Posted: Thu Aug 13, 2015 2:21 am
by reload
Good morning! Which is the best way to manage memory? If here a good example? Is paging the best variant?

Re: Best memory manager

Posted: Thu Aug 13, 2015 2:28 am
by Combuster
Considering you mentioned paging, you're looking for virtual memory management? If so, paging is in most cases the correct answer. At least it is good practice to get used to the basics before you worry about intricacies.

(And as long as you appear not to have read all the relevant wiki pages, there's little more to talk about.)

Re: Best memory manager

Posted: Fri Aug 14, 2015 2:39 pm
by onlyonemac
I've been researching memory management, and the best way to get started is to implement a physical memory manager to allocate physical blocks of memory (usually one page (4kb) in size) and a virtual memory manager to map those blocks to the virtual address space for each process/thread. I'm still working out the details, but keeping a bitmap of physical memory blocks is a good starting point (and not bad for continued use; if you prefer it's always quite easy to change something like that later if you keep your code properly modulerised) and having a page directory block for each process/thread is likely to get you quite far with changing the virtual address space on a context switch.