Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

DOOM Memory Management Question

Recommended Posts

I have been testing PWADs on the classic XBOX and WII to find out what works with what port, etc. Each system is limited to 64Mb of RAM, and I understand that the DOOM executable for each system has to reserve a space of RAM for itself too. So what I am wondering is how DOOM loads WAD and the resources in them, into memory. Does it load up everything all at once, thus a 24Mb PWAD would take up 24Mb of RAM, or does it load resources such as textures, songs, sprites, sounds, and the like until they are needed? My goal is to understand my limits and understand why DOOM on each console occasionally pauses for a millisecond, what size PWADs I am limited to, and so forth. 

Thanks in advance!

Share this post

Link to post

The Game Engine Black Book on Doom says the following:



Once a lump location has been found, a memory block is requested from the memory allocator. The content of the lump is copied from HDD to RAM and returned to the caller.


From that alone, it could be understood that some form of RAM "caching" is going on at the very least. I doubt that the amount of RAM required is dependent on the WAD size, though - if that was the case, computers back in 1993 would have run out of RAM before doom.wad was even halfway in. Or if it is, it isn't quite as radical as that.

Share this post

Link to post

Doom had by design a requirement of 4 Mb of RAM, this should be enough to play any level of the game with all assets needed for it, including menus and such.


That said, it uses a caching system, loading assets as they are needed and marking them as purgable once they aren't needed anymore (or are expendable at the moment, i.e. the data of the immediately previous level).


The 4 Mb are not reserved at start (except for the NexTSTEP version, which did this to ensure Doom never asked for more), they are allocated as needed and in modern computers the entire game fits BUT Doom will never try to load everything up front.


As stated in the Game Engine Black Book Doom:



The engine runs on a clearly-established memory budget. Upon starting up on NeXT the memory manager allocates 4 MiB of RAM and not a byte more. This is done in order to make sure the advertised minimum 4 MiB configuration is sufficient. On DOS the memory manager checks that the machine has at least 4 MiB but will use up to 8 MiB if available in order to improve its cache retention.


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now