[gameprogrammer] Re: memory management in a game with LOTS of art

  • From: Petri Latvala <adrinael@xxxxxxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sun, 04 Jul 2004 10:24:17 +0300

On Sun, 2004-07-04 at 09:40, Alan Wolfe wrote:
> He has increasingly more art/mem usage as he adds stuff in (obviously)
>  and was working on a solution to somehow prioritize the art of what
>  stays in RAM and maybe storing the low priority stuff in files or
>  something?
> 
> I dont think he really has a clue and myself, I've never dealt with
>  this issue before.
> 
> Anyone out there know how to deal with this issue, of what to do when
>  you start to aproach too much art to load all into RAM at one time?

Implement some sort of proxy through which to use the art. It would keep
the art on files, and load them to a cache when used, dropping the cache
at times to save memory. When to drop the cache is a tough one.

The obvious solution is to drop the least-recently-used art when there's
too much stuff in memory. But that doesn't apply to all usage patterns.
If you use art in the way of use-art-1, use-art-2, use-art-3, use-art-4,
use-art-5, repeat, you should drop the most-recently-used art instead.
The end result is that you can keep drawing more without needing to go
to disk, what would have happened if you had dropped art 5 when drawing
art 2, instead of dropping art 1.

--
Petri Latvala




---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: