How can I pre-load files into memory?

7,304

You almost got it. Get that RAM disk going and copy the texture1.dss file to it. Now rename your original file to something else for safe keeping (RAM disks are not that reliable you know) and remap that file to the RAM disk on the filesystem level. Whoa, crazy stuff, how do you do that? Not really, it's simple with the program you can find below and there's a lot of instructions (you don't need to read it all though, it's really simple) so I'll just leave you to it, if you got this far it should be easy for you.

http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html

You should probably shut those virtual machines down though, you need to make sure that you still got plenty free RAM when the game is running and you got the RAM disk loaded. If you fill your memory up Windows will have to swap and that will only make everything a lot worse, so keep your eye on RAM usage.

Share:
7,304

Related videos on Youtube

Benjamin Manns
Author by

Benjamin Manns

Expert Ruby on Rails and Go developer. Engineer at Doximity, a social network for doctors. We have over 70% of U.S. physicians on our network—join us!

Updated on September 17, 2022

Comments

  • Benjamin Manns
    Benjamin Manns 5 months

    Okay, so here's my dilemma. I play the game League of Legends, which has a loading screen showing the progress of each user loading the game. So, if user A has a Pentium 10 Super X-5000 deca-core processor with DDR15 RAM (fictional), and user B has a 2 kHz processor from the 60s, it shows user A loading much faster. A friend of mine just got a new computer (better than mine), so he's going to show up as loading faster than I will. I want to change that.

    Now, into the more general question:

    I have 4 GB of memory. Is there any way that I can preload some files into memory (i.e. forest.map and textures\*.dds, etc)? The entire game's folder is 2.7 GB, which is sometimes taken up on my machine by running virtual machines.

    I looked into the way that Windows prefetching works, but I don't think that that is what I am looking for. I have also looked at RAM disks, but I believe I would be required to re-install (and update) the game into RAM, when I really just want the C:\x\y\z\texture1.dds file to be mapped into memory.

    Any help is much appreciated.

    • Gnoupi
      Gnoupi over 12 years
      Gaming questions are off-topic on this site. However, the general question of "how to load a file in memory" is acceptable. Let's forget the gaming part in it and focus on that.
    • Benjamin Manns
      Benjamin Manns over 12 years
      Yes, I know. The game is the motivation behind the question, which is why I presented the information. The actual question is, I believe, relevant.
    • Gnoupi
      Gnoupi over 12 years
      Yes, I was only emphasizing this point, to avoid some close votes for off-topic.
  • Benjamin Manns
    Benjamin Manns over 12 years
    That makes a lot of sense. I'll try this and another thing it reminded me of - copying the file folder to a RAM disk, renaming the original, then symlinking it to the RAM disk. That way I wouldn't have to reinstall.
  • Gnoupi
    Gnoupi over 12 years
    The bottleneck is for sure the hard drive, in this case. Besides, focus on the "I want to put files in RAM" need, rather than judging why he wants to do it.
  • Don
    Don over 12 years
    Right, you could do it with the entire game if you got enough RAM using the very same method. Though in my experience you can move or copy a game to another location normally on the same computer and it will still work fine. Well, except for the shortcuts and uninstaller of course.
  • Enigma
    Enigma over 8 years
    Your point about getting a faster permanent data storage unit (SSD, HDD) is relevant but RAM -> faster than -> SSD -> faster than -> HDD. The idea is to store the game data in a RAMdisk image on a HDD (or SSD) and then preload everything into memory so when the game needs additional data it only has to go from RAM to RAM instead of HDD to RAM (orders of magnitude faster). The system will then have a new bottleneck likely to be the CPU if in fact the bottleneck before was the HDD. If you got an SSD instead, you still might even hit a CPU bottleneck if your CPU is just that old.