Memory management

Does kernel include memory management?

I’d guess it does, as the R5 kernel did, and there are vm/ and vm2/ directories in the kernel source

stormbind wrote:
Does kernel include memory management?

Sure it does, but it’s not yet in its final state. The current VM written by Travis is under vm/, and Michael wrote one which is not yet integrated or completed in vm2/.
I don’t know yet where we end up with those, though, probably it’s going to be a mix between the two.

Does haiku have a memory management algorithm?


Please, there is no need to ask the same question 3 times and in 3 different and very old forum topics.

Yes, of course we manage memory. The memory allocation is handled by the hoard allocator (, version 2 to be precise. This implements malloc and free and the usual allocation functions (realloc, calloc, …). It needs something lower level to provide it memory from which to allocate, in Haiku this is simply called the VM (virtual memory manager). That is also accessible using lower level APIs such as create_area, get_area_id, …, but also manages other things such as the file and disk caches.

I would say it is one of the more complex parts of Haiku, because it manages so many things and is quite important to good system performance.

1 Like