From 34f7c86caf2f9f990bbaf7f431078f3bd2264daa Mon Sep 17 00:00:00 2001 From: bergwerkgis Date: Wed, 16 Dec 2015 11:29:22 +0000 Subject: [PATCH] AppVeyor: try to increase page file size via powershell --- scripts/appveyor-system-info.ps1 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/appveyor-system-info.ps1 b/scripts/appveyor-system-info.ps1 index e061c98e2..662df3451 100644 --- a/scripts/appveyor-system-info.ps1 +++ b/scripts/appveyor-system-info.ps1 @@ -5,9 +5,29 @@ $physical_mem = get-ciminstance -class 'cim_physicalmemory' | % { $_.Capacity/10 $PF =gwmi Win32_PageFileUsage $PageFileLocation = $PF.Name; $PageFileSize = $PF.AllocatedBaseSize +$CurrentPageFile = Get-WmiObject -Class Win32_PageFileSetting Write-Host "physical memory : $physical_mem" Write-Host "total physical memory : $total_physicalmem" Write-Host "page file system managed : $SystemManaged" Write-Host "page file location : $PageFileLocation" -Write-Host "page file size : $PageFileSize" \ No newline at end of file +Write-Host "page file size : $PageFileSize" +Write-Host page file min size : $CurrentPageFile.InitialSize +Write-Host "page file max size : $CurrentPageFile.MaximumSize" + +#disable automatically managed page file settings +$c = Get-WmiObject Win32_computersystem -EnableAllPrivileges +if($c.AutomaticManagedPagefile){ + Write-Host disabling managed page file settings + $c.AutomaticManagedPagefile = $false + $c.Put() | Out-Null +} + +$new_page_size=8192 + +if($PageFileSize -lt $new_page_size){ + Write-Host "settings new page file size to $new_page_size" + $CurrentPageFile.InitialSize=$new_page_size + $CurrentPageFile.MaximumSize=$new_page_size + $CurrentPageFile.Put() | Out-Null +}