AppVeyor: try to increase page file size via powershell
This commit is contained in:
parent
d75fd12eab
commit
34f7c86caf
1 changed files with 21 additions and 1 deletions
|
@ -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"
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue