windows 8 - Temp folder in ramdisk

23
2014-04
  • Nick Russler

    I have a computer with windows 8 x64 and 16GB RAM.

    I bought a SSD, but still want to get the last bit of performance out of my computer ;)

    Does it make sense to put my temp folder into a ramdisk?

    How big would it need to be?

    For example when winrar extracts doesn't it use the temp folder?

    For example: What happens if I unpack something as big as 20GB?

  • Answers
  • Mokubai

    WinRAR and similar will generally use the ramdisk to unpack data when you drag files out of the WinRAR window directly into Explorer or similar. If you simply right-click and click "extract to" then it will extract directly to that location.

    I have used a Ramdisk for some time and found almost no problems using a Ramdisk with a size of 768MB with the Temp directories set to the ramdisk. This is on a machine that is rebooted daily. In my experience the actual daily use of the temporary directory is quite negligible.

    The largest use of the temp directories happens with installers or as I mentioned when you browse an archive in WinRAR or similar and then drag a folder or item from that window to Explorer. The main reason for using the temp directory there seems to be that, not understanding the Rar format, the Explorer drag-and-drop function needs to be told "here is a file/folder for you" which needs that file/folder to be temporarily extracted. If you extract a file using built in functions "Extract to" or via the right click menu then the temporary directory should not be needed.

    Due to the rather limited use of the Ramdisk (I saw a worst case of ~200MB used) I started using it more as a scratchpad for temporary work that I was happy to loose at the end of the day.

    I don't think you are going to see any real performance benefit unless you put your browser caches there as well and set up other software to use it. In that case it it more important to think about their use of the ramdisk rather than Windows and Winrar.


  • Related Question

    memory - Is putting the swapfile & temp folder to ramdisk a good idea in Windows 7 64 bit with lots of RAM?
  • Tony_Henrich

    I want my Windows to run as fast as possible. If I have 12GB RAM in Windows 7 64bit, quad core CPU, and all apps fit in memory, will the swap file ever be used for anything? The question is about if it's a good idea to put the swap file in a RAM disk.

    Would a RAM disk help in any way or will Windows intelligently use all the available memory for all its work?

    I am also thinking of putting the temp folder on a RAM disk. I know the RAM disk is volatile memory and I don't care about its content if it gets lost.


  • Related Answers
  • Floont Artney

    I agree that putting the swap file on a ramdisk doesn't make sense for a 64-bit OS. However, if one has 32-bit WinXP, then Windows can only "see" the first 3.5GB of RAM. If one has more RAM, say, 9GB, the RAM above 3.5GB is completely wasted by WinXP. However, using a program such as SuperSpeed RamDisk Plus, one can use the memory above 3.5GB as a ramdisk - and putting the swap file up there makes a tremendous amount of sense (again, on 32-bit XP, not 64-bit Win7).

    Separately, putting temp files in a ramdisk almost always makes sense, performance-wise, unless the anticipated size puts too big a dent in the RAM available to the OS.

  • user43161

    Putting the pagefile on a ramdisk is a ridiculous idea. You have to understand that only a fraction of total paging will involve the pagefile. Most paging will be with executable and other mapped files, and a pagefile in RAM will do nothing to improve this performance. And thanks to the reduced system ram available there will be more of this paging. The result is that pagefile access will be faster but overall paging levels will be higher with a reduction in performance.

  • user102648

    I would not say ridiculous; for neither 32 or 64 bits systems.

    To start with the obvious, 32 bits windows (the majority of running systems) simply ignore anything above 4GB. Ramdisks being able to use PAE and 36 bits memory addressing, they are to my knowledge the only way of making high memory areas useful in 32 bits systems.

    Question is : how do we make use of a lightning fast / more secure virtual hard disk ? Temp files come to mind and are pretty trivial to setup, as long as you know how to assign a fixed drive letter in Windows. Same with browsers cache. The interest for these is quadruple :

    • Fastest access/retrieve
    • True deletion
    • Suppresses most of useless wear on expensive SSD memory.
    • Less disk fragmentation..

    As for the swap file, it seems obvious that 32 bits systems have a lot to gain with putting them in unclaimed RAM. One could think of a memory hungry program, using up to 3 GB on itself (with the 3GB switch in boot.ini) that will most likely cause a lot of swapping. Two of the same bonuses still apply: true deletion and wear on SSD. Fragmentation is less of an issue with swap files.

    There is more : it is quite common for poorly written programs to use virtual memory, no matter how much physical memory available, causing useless disk access. This holds true for both 32 AND 64 bits programs. I even came across programs that will just fail to launch in the absence of a swap file.

    Bottom line, while it makes sense no matter what to have a ramdisk below 4GB and save useless disk access for temp folder and programs caching, it seems much preferable to install more than 4 GB, memory price being what it is, in both 32 (with PAE enabled hardware) AND 64 bits systems and move the swap file there.

    One should note that A LOT of professional computer users still can't go 64 bits for hardware support reasons.

    What would be ridiculous, to use the same strong language as above, would be to just dismiss the idea and rely not only on Microsoft's virtual memory handling (which is praised and rightly so) but also on application programmers who range from the assembly coding guru to the high level language idiot that will bring the nicest-most-stable-PC to its knees just through bad memory handling. I've seen such code in mainstream programs, productivity applications, I kid you not !

    My main system has a 8GB ramdisk on XP/32 and this has proved useful. It's quite trivial to setup and I must say the only program that gave me a hard time is google chrome whose installation/update strategy is hard on the tweaker.

    You can think of a lot of useful use for ramdisks apart from these ; in my case, audio samples to retrieve from disk on live applications : put them there at bootup time (painfully slow) and get lightning fast access to multiGB libraries. But this is way off topic :)

    This is my own experience. I wish people would not destroy the value of useful information by the use of unnecessary strong language. Ridiculous was a bad choice of word in this context, to say the least.

  • JdeBP

    Yes, paging files are used even if one has lots of RAM; but the simple existence of a paging file is not by itself a factor affecting system performance. Putting a paging file on a RAM disc is daft, moreover. The point to a paging file, after all, is to be a place for holding (transient) page data when those data are not currently in RAM. RAM discs are in RAM …

    Placing temporary files on a RAM disc is a wholly different kettle of fish, of course.

  • slhck

    It is actually not a bad idea in my opinion.

    Logically, people misunderstand "page file" or more correctly "swap file" as RAM. It is true that the swap file holds similar data as RAM holds. But Windows does not use this like RAM. As you see today in the growing multitasking world we live in, Windows was designed back in the day to handle the limited amount of RAM by constantly writing between swap file and RAM.

    The swap file is always used by Windows since the performance gain is more noticeable on older slower computers with few programs running. As you open a window, the program gets swapped into RAM, as you are working in it.

    Let's say you're writing a letter in Word. If you have just started that program with many programs\windows in the background, it tends to be slow, but then runs smoother after a few seconds. Then, when you switch to Internet Explorer, it runs slow, then gets faster because it was in page file and then swapped to RAM, while all background processes get loaded into the page file.

    Now let's introduce the RAM disk to Windows. Put the swap file on the ramdisk instead of the HDD and you have improved the ability for Windows to multitask, since RAM is faster than the HDD/hard drive. However this won't help on an older system unless you buy a physical RAM drives – and you may have to set the pagefile again in Windows as without power it will be deleted.

    Pagefiles get very pointless for newer PCs with 8, 16, 32, 64 Gigs of RAM.

  • Andrew

    I doubt you would see much difference moving your pagefile to ramdisk. If you wanted to force windows to use ram you could turn off the paging file.

    However I noticed a large difference moving my IE temp files to a ramdisk and setting my TEMP and TMP enviromental variables to point to the ramdisk.

    I also run Google chrome with the flag "-user-data-dir="R:\ChromeTEMP" so it stores temp files on the ramdisk. This will cause it to forget your settings. But since I use the sync feature it didn't effect me much. After the initial sync everything was back to normal. And skyrim loading screens are shorter after linking to copies of some files on my ramdisk.

  • Darth Android

    Windows will continue to use the swap file, which (much to my confusion, since I have an identical setup) didn't make any sense to me. However, after disabling the paging file, I saw no real performance improvements. I've since gone back to using a page file, since windows uses it for things other than virtual memory (I think it also writes crash dumps to it, when you bluescreen) which I need. I've also blown through my 12GB of RAM several times, and was thankful I had the wiggle room.

    In short, Windows will still use the page file, but you shouldn't notice it as a performance hit.

    As for temp files, moving those to a ram disk should increase their access speeds, though make sure that you won't need anything in there to persist through a reboot/crash and that the ramdisk driver loads and creates the ramdisk before any applications or the system needs to use the temp folder.

  • slhck

    I've got W7 32bit with 6GB RAM, obviosuly it addresses 3.2GB only wasting the remaining 2.8GB.

    I found that Dataram's RamDisk (freeware) can address those >4GB via PAE so I set it to create an E: drive of 2048MB (0.8GB have gone somewhere...). In there, I've put the PageFile — or better 50% PageFile and 50% ReadyBoost.

    I have noted important improvements on random seek file and this was supported by Perfomance Monitor figures.

    Anyone else tried similar configuration or a better idea on how to use >4GB wasted RAM?

  • Slawek

    Most of you sceptic guys forget the 32-bit Windows RAM limit and miss the fact that you can't put there more code & data into RAM, than the 3,5GB. Or, you just believe we're trying to "cut off" say 2GB out of the accessible 3,5GB - for fast pagefile, with the cost of reducing available memory down to 1,5GB. This is certainly pointless, but that's not our idea. Our idea is dedicated to the users of 32-bit Windows, who own PCs with MORE RAM than that nagging 3,5GB limit. For example, a machine equipped with 8GB, running 32-bit XP or Vista or 2003.

    When you work hard with many applications simultaneousely, the system often faces condition of exhausting memory. To avoid critical error system is forced to store some data of background-running applications to pagefile. Typically it means writing tens and hundreds of MB on the hard disk. And remember - it happens often, when you really make use of multitasking (nowadays common, as well as memory-consumming apps). And when you get a background app to foreground - another batch of data from RAM must go to HDD, just to make space in RAM for previous batch to come back from HDD (this time writing and reading many MBs from disk drive). Just observe your red HDD activity LED - it lights more than stays off (your HDD works really hard).

    Now imagine all of these operations redirected to EXTRA RAMdisk (extra RAM, beyound the system's operational memory area which remains the same in size - maximum).

    • This way it works 1000 times faster (RAM operations compared to HDD) so time of swapping becomes marginal;
    • Your HDD works way less than typically, it gets quiet, cool and the lifetime extends remarkably.

    I disbelieve it would be pointless in terms of performace, not to mention hard drive reliability.

    OK, most machines built in the XP era weren't based on mainboards capable to support more than 4GB of RAM. So I understand there are few guys out there who really care/need and understand the idea. But now...

    WELCOME TO THE VIRTUALISATION ERA! More and more of you are lucky to own a machine with plenty of RAM. A newbie can configure his host system to assign 4GB to the guest 32-bit Windows, and still have lots of RAM. It would be really precious then, to enrich it with a 4GB RAMdisk, assigned to the same guest OS, dedicated for pagefile with no cost of guest's RAM space!

    A server I supervise has 12GB. Instead of buying new system (64-2008 plus CALs!), I could assign 8GB for guest - virtual 32-2003 and try testing software RAMdisks. However I don't trust them as they seem to be hacks and I don't like taking chance on stability. This is why I'm looking for a solution to prepare my host's Linux Ramdisk as a blockdevice and format it to FAT or NTFS in order to make it acceptable for guest OS's virtual disk, to put pagefile on it. I believe my server would boost and save lots of disk effort.

    Where am I wrong? Greetz!

  • Keltari

    In regards to the temp folder, moving it to a ramdisk would increase speed.

    However there are things to note:

    • loss of power would mean loss of data
    • not every application uses the temp folder provided by Windows, some use their own
    • if the temp folder ran out of space, applications or Windows might crash
  • Dave Rook

    Ramdisks are useful for things like fast internet cache of IE, Chrome, and Firefox etc.
    Putting the pagefile on a Ramdisk in a 64 bit system is useless.

    DisablePagingExecutive might better suit those needs. But putting the pagefile on a Ramdisk in a 32 bit environment with more than 4 GB of Ram is a huge improvement. However, if your computer is a single core processor (only one according to the taskmanager), there will be improvement (can't remember exactly how much , it has been a while). But you also need to set ClearPagefileAtShutdown to get rid of the error on next reboot because the pagefile won't be there.

    The best use for a Ramdisk that I can think of is to mirror your program files folder (or select programs) into the Ramdisk.

  • user44038

    Actually, the 4GB limit on 32Bit windows (Vista +, dunno bout XP) is software imposed. You could actually "hack" the kernel to allow a 32bit system to access 4GB+ (This would be in voilation of MS Licencing agreement though :)) 32-Bit windows vista + allready uses PAE, therefore can address 36bits not just 32(otherwise DEP would not function).

    The 4GB limit is MS's way of reminiding you you need to pay them more to use your full hardware capability(Provided you got 4gb+).

    See: http://www.geoffchappell.com/notes/windows/license/memory.htm