In my game engine I currently use a singleton called MemoryManager (don't hate me for using singletons the engine only uses two) that allocates a big chunck of memory during engine initialization and then every sub-system "asks" the MemoryManager for a Allocator of some size.
So the big chunk of memory is split across all sub-systems... this prevents memory leaks since there's only a malloc/free pair.
The problem I'm facing is how to determine the amount of memory each sub-system needs because the sub-system have to provide the amount of memory they'll need when creating an Allocator.
I could stop using the allocators the way I do and have them ask the memory manager for more memory every time an object has to be created but that could lead to poor cache usage...
Any thoughts? Thanks.