0
In the office, I do my work on a Windows 7 machine that has 16GB on RAM. However, after each restart it automatically sets the pagefile to 3072MB. I have created a delayed schedule task (which calls a Powershell script) to increase it to a more appropriate value, but sometimes it fails.
Even if the startup script works, the pagefile size gets reset from time to time (maybe some administrative scripts are run).
So, I thought of digging through startup scripts using Autoruns. I have found some Powershell scripts, but cannot find anything related to pagefile being set.
I have also taken a look upon Event Viewer, but could not find any event related to page file size being changed.
I have also talked to the local IT, but they do not seem to know what is causing this.
Question: Is there way to detect Page file size change source within Windows 7?
Powershell script I use to change pagefile size:
$computersys = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges;
$computersys.AutomaticManagedPagefile = $False;
$computersys.Put();
$pagefile = Get-WmiObject -Query "Select * From Win32_PageFileSetting Where Name like '%pagefile.sys'";
$pagefile.InitialSize = 12288;
$pagefile.MaximumSize = 12288;
$pagefile.Put();
You can change the pagefile size from system managed to a fixed size, Control Panel>System>Advanced System Settings>Performance settings button>Advanced Tab> virtual Memory "change" button. After you configure it in there be sure to hit the "set" button then OK all the way out. Set pagefile to 1.5 times the physical memory. Reboot is required to make settings active. – Moab – 2018-08-30T14:52:01.880
@Moab - yes, I am already doing this (especially when I see that the script I am running does not perform the change), but it gets reset from time to time and after each boot. That's why I am trying to find out what is really performing the change. – Alexei – 2018-08-30T14:53:36.000
@Moab - in my case rebooting is not an option, but I saw that the file size is increased even if I do not restart (might depend on how much virtual memory is used, it is not clear for me). – Alexei – 2018-08-30T14:54:54.680
Evidently the changes your script makes are not permanent, maybe something in the script does not set the changes, no way to know unless you post the script and let others have a look at it. Never seen this issue before. – Moab – 2018-08-30T14:59:15.790
@Moab - I have added the script, but the page file is being set to a small value even I manually set the size (I set the size, the computer freezes several seconds once the file is allocated and pagefile.sys indeed gets to the set value). – Alexei – 2018-08-30T15:02:02.947