Advertisement

RMU Lists vs. Explicit Loading

Started by May 25, 2000 03:29 AM
1 comment, last by Wayfarer 24 years, 6 months ago
What are the advantages/disadvantages of RMU (recently most used) lists vs. explicit loading/unloading of bitmap/sound data from file? I don''t know much about RMU lists since I have never used them before, but I guess it can be implemented as a linked list stack queue. Any bitmap that is requested to be loaded is searched in the list, and if it is not found, a RMU node is created and pushed onto the top of the stack. The bottom node is then removed from the stack. If a bitmap is requested to be loaded and it is already found in the list, its node is merely removed from wherever it is in the stack and then pushed back on top, to keep it active in the RMU list. Explicit loading would be that you know exactly what files are to be loaded/unloaded. So, for example, if you were going from the main menu screen to the start of a new game level, you would have to explicitly unload all main menu bitmaps, then load all your game level bitmaps, one by one. I really can''t compare the two methods since I have never used the first one before, but my best guess is that with explicit loading, you can save memory by only having what you need loaded. But with RMU lists, you really don''t know what is loaded or unloaded, so you might be taking up memory. Also, there has to be some kind of limit to the number of RMU nodes you can have in the list. What if some part of your game exceeds this number in bitmaps used? What if you need to have a lot of nodes because you have hundreds of small bitmaps, but you also have a couple of very large bitmaps? Wouldn''t it take awhile for these large bitmaps to propagate through the list if you had a long queue, thereby taking up valuable memory? Any thoughts?
I agree, but RMU can be useful too. If you often load/unload lots of things, RMU allows you not to load 100 times the most used files, but to keep them in memory.

It''s a kind of buffer.



Prosper / LOADED corporation
Advertisement
I was thinking maybe instead of having just one RMU list for your entire
program, you could have two for each type of media. One list for small
bitmap files like tiles, and one list for huge background bitmaps. And
the same thing would go for wav files, one list for looping background
music and one list for small wavs like mouse clicks.

But, I don''t know if I would really like RMU lists because I think it
would be hard to track down memory leaks since you really can''t be sure
what is loaded or not.

Wayfarer

This topic is closed to new replies.

Advertisement