Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was playing Starcraft 2 on my machine with 32GB RAM. I was thinking on how the game only ever maxes out at ~2GB, but it still has to load the different single player maps.

I see the memory structure as "the base game framework + current level goes to working memory" which would include all the music, sprites, etc. When I go to load another level, I get several cache hits from the framework, then several misses as the application goes to fetch the new level from my HDD.

My question is if anyone knows if there is a way to cache the entire game folder, as it only is 13GB, thereby making any and all accesses to any game-related resource a RAM-Cache hit and thereby reducing load times?

I would think if it were all in RAM (PC3-12800), the theoretical bandwidth is ~12GByte/sec, which would make all loading near instantaneous, no?

share|improve this question
    
Would be interested to hear your results if you do try the RAM drive suggestion. –  Louis Apr 2 '13 at 6:12

3 Answers 3

Why don't you try installing it in a ram drive, or moving the files there? Short of reverse engineering the program, a ram drive is probably the best way to go.
Here's more superuser information on ramdisks: Is there any open-source RAMDisk software for Windows?

share|improve this answer
    
The game may also need to write some data back to the drive and those changes will be lost with a RAM drive. Remember to manually copy everything that has changed back to regular drive after playing. –  gronostaj Apr 2 '13 at 7:27
    
You don't need to install it to the RAM drive -- just move it there, and create an NTFS junction from the old location to the new -- any time a program tries to access the folder it will be redirected to the RAM disk automatically. -- If it has other data elsewhere on the drive, again, move it, and create a junction from the old location to the new. ImDisk is a good tool for this, because at start-up / shut-down it will persist the ram disk's contents to/from the physical drive. -- You can do this with any game or file folders. –  BrainSlugs83 Aug 21 at 18:35

Your operating system is already doing exactly what you wanted - it actively caches in RAM all data that was read from your hard drive in most recently used fashion.

For any OS that worth its salt, really "free" memory should be really small amount - just few megabytes. All remaining memory is devoted to caching disk data. If some program requests big memory block using malloc or GlobalAlloc, non-important data cached for read is thrown away to satisfy this memory allocation request.

One interesting property about this caching is that even if you have 32-bit application which cannot allocate more than 4GB of RAM, files accessed by this application will be still cached by your 64-bit OS, even if total size of all files is well beyond 4GB.

In other words, if you have 32GB RAM, and you start playing your game which weighs in at 13GB, Windows will try to actively cache all 13GB in RAM. However, it does not mean that it will stay in that cache forever, because most likely data is highly compressed, and as Starcraft needs to unpack this data in memory to be able to manipulate it and create your gaming world representation, it might try to allocate a lot of memory from Windows, which may force it to throw away some of that cached content (but even then, in least recently used manner).

On a practical note, probably easiest way to speed up load times is to use SSD drive. Modern SSD drives typically have read speed around 500MB/s - around 5x faster than typical hard drive. What's better, SSD read speed does not take a huge nose dive on reading really small files (for standard hard drive, read speed could be 100x slower for small files).

share|improve this answer

Open FAR Manager or Total Commander and copy the entire StarCraft folder to nul. It will be loaded into memory.

But I don't think this will speed up loading a lot. To load 100 MB from a couple of files is not a problem. Only if you see HDD led is flushing almost constantly you may suppose that HDD is limiting your performance.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.