Advertisement

Damn cache!

Started by February 04, 2000 11:04 AM
5 comments, last by Hans 24 years, 10 months ago
My game needs about 10 megs of memory, but usually Visual C has already allocated all my memory (96 megs). So when I start the game, it runs slow at first (because game data is in cache) and after a while it usually starts to run smoother (windows puts visual c data in cache and my game data in memory). How to make this cache->memory happen faster? Or how to tell windows to put everything else but my game in cache so I would have all the memory? -Hans
Try SetProcessWorkingSetSize. I have no idea if that is what it does but it looks similar...
Advertisement
What cache are you refering to? Cache is a good thing, and is better than memory. Are you talking about disk caching? That''s called paging. Just clarifying the terminology, because I don''t fully understand your question.

Rock
Yeah I meant paging.
You could allocate all the memory you need at runtime, touch all that memory (read/write access) then use that memory with selfwritten dynamically allocation-routines. Carmack did it the same way in Quake and I think Tim Sweeney used a similar technique with Unreal. However, managing memory isn''t such an easy task. (maybe some-one could write a tutorial on that?)

hth
gimme de cassshhhhhh.......

Carl "trixter"[email=carl@trixoft.com]carl@trixoft.com[/email]http://www.trixoft.com
Advertisement
You could try raising your app''s priority. That should at least disuade Windows from paging it out. But if another program needs memory, somebody is going to get paged out no matter what. I don''t know what algorithm Win uses to decide who to page out (non MS apps 1st , but increasing the priority should certainly help.

Rock

This topic is closed to new replies.

Advertisement