configure windows to QUICKLY delete pagefile on shutdown? (not wipe)


  1. Posts : 58
    windows
       #1

    configure windows to QUICKLY delete pagefile on shutdown? (not wipe)


    so I just discovered what may be one of the dumbest design choices ever if this is true: when configuring windows to clear the pagefile on shutdown (by flipping the ClearPageFileAtShutdown value in registry to 1) windows actually overwrites the entire file (with zeroes probably)
    so obviously when that file's several gigs then it takes several minutes to shutdown

    anyone found a way to instead tell windows to simply delete it instead? (like users can do by right-clicking delete with the mouse or typing "del pagefile.sys" in command line)



    PS. I wanna delete that damn file on shutdown not for security reasons but practicality: so that when backing up with Ghost I don't have to delete it manually (which isn't possible to do in command line outside windows anyway)

    also I've read that starting windows without previous pagefile seems to slightly improve performance or something, dunno if that's true
      My Computer


  2. Posts : 9,746
    Windows 7 Home Premium 64 bit sp1
       #2

    I might be wrong but I would think that Windows empties the Page file on shut down & this is often the reason shut down can be delayed.

    A good back up program should not include the Page file as files in the Page file are going to vary all the time, so backing them up would seem futile.

    Fiddling with the Page file will probably end up in tears as you really don't know what files are in it.
      My Computer


  3. Posts : 2,497
    Windows 7 Pro 64 bit
       #3

    I very much doubt Microsoft would provide an option to delete the pagefile on shutdown. Raymond Chen, a Microsoft developer since Windows 95 days, would call this a security hole disguised as a feature.

    From a security standpoint, which is the entire purpose of the registry setting, deleting the pagefile would serve no real purpose. As is quite well known recovering a deleted file that has not been overwritten is not particularly difficult. For any hacker wishing to access the pagefile this would be a mere speedbump. Overwriting the pagefile is the only way to provide the security the setting was designed to provide. Windows will not allow deleting the pagefile while it is running. That would almost certainly result in a system crash.

    Yes, overwriting a large pagefile will take time. That is why it is not enabled by default. In a high security environment this might be a good idea but it makes little sense outside a comprehensive security policy. Most computers have security holes more serious than an uncleared pagefile. The setting has no other benefits.

    Most disk imaging software will either provide an option to not copy the pagefile or will not do it at all. Macrium Reflect simply will not copy the pagefile or hibernation file in an image backup.
      My Computer


  4. Posts : 17
    Windows 7 Home Premium 32 bit
       #4

    There is a configuration which will achieve your object, and that is to set up a 'ramdisk' or 'virtual drive' in memory, and configure Windows to place the pagefile in the ramdisk (not on drive C).

    You may need to instal more RAM to make this feasible. If you're using 32-bit Windows, you are limited to a total of 3.2Gb (usable), so you would configure the ramdisk to use no more than (say) 1.5Gb. Of course, if you are using 64-bit, the sky's the limit. There are some good freeware ramdisk drivers out there for download, but they are not all equally fast (or user-friendly to set up!), so you should do some googling for benchmarks and reviews before you make a final choice. Advantages of a ramdisk pagefile:

    (1) Instantaneous response, because it's located in memory.

    (2) It evaporates instantly when you shut down. A new blank pagefile is set up each time you boot Windows (this has no impact on boot time).

    (3) Any malware which has established itself in the pagefile is flushed away on shutdown.

    I know this is a tardy reply, but I've only just come across this thread!
      My Computer


  5. Posts : 58
    windows
    Thread Starter
       #5

    1) is it true ramdisks use up an entire core of the CPU?

    2) if pagefile is on a ramdisk what happens if I boot into safe mode will ramdisk still be there (and if not where will the pagefile be stored?)
      My Computer


  6. Posts : 31,242
    Windows 11 Pro x64 [Latest Release and Release Preview]
       #6

    If you have enough spare RAM to host the Swap File (Pagefile), it's far better to leave things well alone .

    The pagefile will only be used if you run out of usable ram so a pagefile in RAM creates an Endless Causality loop.

    as the default for the page file is 1.5 times the amount of installed RAM, it's an impossible task to have this stored in RAM, if you have enough ram to spare just reduce the size of the Pagefile to 256MB, (some programs expect the Pagefile to be present so it's detrimental to the system to set it to zero). Also if you are running an SSD or other Solid State Disks there is little access overhead for the traditional PageFile .

    The whole concept of a ramdisk was to use spare ram to speed up operation of programs by using it as a fast disk. Modern SSD's are now cheaper and faster that the older HDDs which caused the problems and indeed they may be faster than the RAM in those days
      My Computers


  7. Posts : 17
    Windows 7 Home Premium 32 bit
       #7

    7point5 said:
    1) is it true ramdisks use up an entire core of the CPU?

    2) if pagefile is on a ramdisk what happens if I boot into safe mode will ramdisk still be there (and if not where will the pagefile be stored?)
    I've never heard that a ramdisk uses an entire core - I'm open to be corrected, but I would be very surprised if that's the case, because ramdisk works perfectly well with single-core processors. It's possible there are ramdisk drivers out there which try to sequester an entire core for themselves, if one is available, but I'm not aware of any. As for working in safe mode, I'm not in a position to test that at the moment, but it might depend on your system. Like any other system device, ramdisk works from a driver loaded at startup, so it depends whether safe mode considers it to be an essential driver or not. If the ramdisk fails to load, the pagefile will default to drive C.

    With regard to SSD's, the pagefile is a very dynamic file which continually varies in size and content, so loading it into a ramdisk will significantly reduce wear and tear on the SSD.

    In a 32-bit system with 3.2Gb usable RAM, I have always found that 1.5Gb is sufficient for the ramdisk, especially if the startup list is cleaned out to the essentials (which is something you should do whether you have a ramdisk or not, because it benefits your system in lots of ways, eg by speeding up boot time and reducing memory consumption).

    The space needed by the pagefile is determined partly by available memory, but mainly according to the tasks you are performing, and I have found that it is generally well under 1Gb on any well-maintained system.
      My Computer


  8. Posts : 2,497
    Windows 7 Pro 64 bit
       #8

    1) is it true ramdisks use up an entire core of the CPU?
    I can't see how this would be even possible. In Windows there is no provision for dedicating a core to a specific process or device driver. Affinity settings don't work that way. You can restrict a process to a single core but this is not exclusive. The thread scheduler can and will use this core for any other purpose it chooses, subject of course to other affinity restrictions.

    2) if pagefile is on a ramdisk what happens if I boot into safe mode will ramdisk still be there (and if not where will the pagefile be stored?)
    Safe mode uses only a set of defined essential services and drivers, which the RAMDisk driver will not be among. If no other pagefile is defined and you boot into Safe mode you will have no pagefile. I am about 99% certain of this. I have no intentions of trying this.

    As for putting the pagefile on a RAMDisk:

    Creating a RAMDisk is usually a poor use of memory. Putting the pagefile on it is a particularly poor use of memory. The idea that it would be beneficial is primarily based on misconceptions of how the pagefile is used. To be sure there are many such misconceptions. Most descriptions I have seen regarding the pagefile are at least partly wrong. Even Microsoft user level documentation is very misleading.

    Having the pagefile on a RAMDisk may benefit certain aspects of performance performance under some specific situations but it will take a hit elsewhere. On the whole it will cost performance.

    The pagefile is simply a place where infrequently used data can be offloaded from RAM thus leaving more of it for more important uses. Putting the pagefile on a RAMDisk results in data being shuffled around from one location in memory to another with no real gains. Don't be fooled by the Task Manager memory gauge into thinking you have a lot of of unused memory. All memory except that labeled as Free is in use.

    These views of having the pagefile on a RAMDisk are not just my own. They are sheared with many Windows experts whose knowledge and experience far exceed my own. And they have used far stronger language than I would care to use here.
      My Computer


  9. Posts : 17
    Windows 7 Home Premium 32 bit
       #9

    Last comments from me...

    Unless you tell it to do otherwise, Windows will always initialise (and use) a pagefile on drive C, no matter how much memory is installed. It's an essential feature of the Windows design philosophy. If you configure a ramdisk pagefile, and it doesn't initialise, Windows will display a message to inform you that it's setting up a temporary pagefile on drive C.

    I once heard that you can force Windows to retain the pagefile contents in volatile memory, without needing to use a separate ramdisk, by executing a runtime instruction. However, I can't find any reference to this on the web. All the discussion suggests it's either impossible or, at best, complex and tricky to set up.

    If it could be set up, I'm not aware what the relative advantages and disadvantages might be, compared with a ramdisk. The configuration might be more likely to crash, because any failure such as a memory conflict, a runaway thread, or a simple memory overflow, would be uncontained and therefore potentially catastrophic. The problem might be contained, or not arise in the first place, if the guilty files were sequestered in a pagefile within a ramdisk; I suspect an overflowing ramdisk pagefile would simply spill over into drive C. But that's just my speculation.

    The point about minimising wear to SSDs is especially relevant to computers which have the SSD soldered directly to the motherboard. Out of warranty, in the event of a breakdown, these are not economically replaceable and the data will probably be unrecoverable, so you would naturally want to maximise life expectancy.
    Last edited by alan1000; 20 May 2018 at 18:57. Reason: to amplify a comment
      My Computer


  10. Posts : 3,615
    Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali
       #10
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:48.
Find Us