OnePlus 5 review
I use my computer for business purposes and, to be certain that I have a secure backup of my complete operating system, I take an Image of my C drive every week using Acronis True Image. I notice that there is always a large element of Paging/Swap file in the Windows directory.
I always thought that this file was essentially an extension of RAM but, unlike RAM it stays the same size when the computer is switched off! My question is, do I need to retain all the data in this file every time I switch off - if not, is there any way I can clear it other than through the ponderous route of 'My Computer, Properties, Performance, Virtual Memory, Disable Virtual Memory, Re-start computer, and switch Virtual memory on again?
I have tried placing this file in another partition on my hard disk but the problem remains!
It is as you say an area of the hard Drive that is used as a extension to the Ram on your system but it is slower it being a hard drive. How much Ram do you have as the swap file can be made smaller
Not familiar with Acronis True Image at all, but does it not give you an option (even when imaging a drive) to exclude or skip certain files (such as temp files) either by deselecting the file itself and exclude by file extensions such as .tmp?
If the swap file is in the WINDOWS directory, you're probably using windows 9x. The file name should be win386.swp. See if you can exlude it.
Even if you empty the file after shutting down, I think the file is still there. If it really bothers you, you can change the size to a fixed smaller size, restart, then image the drive.
In my simple mind the swap file contains data that may be required for immediate use within the programs that are currently running - today!
If I am running a new program, and inputting data today, and the Swap file is full, todays data still goes in to it and MUST overwrite some of the exisiting data. If it fits perfectly, no problem, otherwise it corrupts some of the data it overwrote.
If tomorrow I have booted up my machine, and the swap file is there to keep regualrly used data, what happens if my computer now calls up the corrupted stuff?
Because of this, I believe that the Swap file should be emptied on shutdown, just as RAM is lost on shutdown.
Nobody seems to know the answer!
I'm sorry, I may not have fully appreciated the purpose of your 1st post.
If your question is just whether you need to back up the swap file when imaging the drive, in order for the restored image to work, the answer is definitely no.
In fact some backup programs exclude the page file by default. An example is Microsoft's own simple Backup. It excludes the page file, temp folders and internet cache.
You are correct in thinking that the virtual memory is like an extension of the RAM. There is no need to back up the swap file.
That's probably all you are concerned about when you made your 2nd post.
But as a matter of interest, even if Windows 9x clears or empties the page file at shutdown as you believe, it doesn't mean the page file will disappear. Windows reserves space for it and even if it is empty, there will still be a swap file called c:\windows\win386.swp on your hard drive taking up the minimum size set for it. Hence it will still show up when you image it.
A similar example is the hibernation file (at least in w2k and XP). If you enable hiberate support, a file will be created called C:\hiberfil.sys, which has the same size as your physical RAM. Once you enable hibernate support, then whether or not you go into hibernation, the file is there, even though it may be empty.
As to whether Windows does clear the virtual meory at shutdown, it doesn't, at least not in w2k and XP.
The difference with RAM is, RAM can only retain data when power is supplied to it. Once you power off the computer and no current is supplied to the RAM, the stuff on the RAM disappears. Nothing is actually done to "scrub" the stuff off the RAM.
With virtual memory, it's on a hard disk. Data is written to it, and retained after a power off. To clear it, Windows has to actively delete the stuff (or at least clear the "indexing").
In w2k and xp pro, there's an option in Group Policy to clear the page file on shutdown (which by default is "not configured"). For XP Home, there's a registry tweak you can do. So at least for w2k and XP, Windows's default settings do not clear the page file at shutdown. click here for the xp tweak, the need for it in the first place being that XP does not actually clear the page file at shutdown.
If you enable this tweak, shutdown will take a bit longer.
Re your thoughts about running a program today which may use stuff on the page file from yesterday, unless the page file is cleared on shutdown. I see what you mean, but logically the potential problem you pose, if it were a problem, could occur even within the same session of Windows.
If there weren't some kind of built-in reference system, for a program to call up the right part of the virtual memory (which could be hundreds of MB or more), the problem could occur whether after a shutdown and restart, or not.
The problem should not occur because when a "page" is created by a program within virtual memory, each "page" has an address, or a reference (I believe it's similar even for your physical RAM). When the program needs to access the "page", it will look up the address or reference in the virtual memory file. That is the solution to your hypothetical problem, not clearing the virtual memory at shutdown.
That is not to say that the reference system for the virtual memory cannot get corrupted, but it's not because the virtual memory has not been emptied after a shutdown.
The swap fill is a empty part of the disc that windows uses like a temp file, just extending memory is a hardware way of doing it
This thread is now locked and can not be replied to.