Virtual-environments: Small pagefile fails GraalVM native-image builds on Windows

Created on 27 Apr 2020  路  5Comments  路  Source: actions/virtual-environments

Describe the bug
I am trying to build a Quarkus application as a GraalVM native-image for Windows.
I am seeing the following error:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000778d00000, 478150656, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455)

https://github.com/38leinaD/quarkus-with-gh-actions/runs/620081929?check_suite_focus=true

If i run "wmic pagefile list /format:list" i can see that the pagefile is indeed only 1.8 GB; which too me is rather small:
AllocatedBaseSize=1791
CurrentUsage=0
Description=D:\pagefile.sys
InstallDate=20200426163236.509377+000
Name=D:\pagefile.sys
PeakUsage=0
Status=
TempPageFile=FALSE

The same was already discussed here: https://github.community/t5/GitHub-Actions/Error-quot-The-paging-file-is-too-small-for-this-operation-to/m-p/55783#M9641

Area for Triage:
Java

Question, Bug, or Feature?:
Feature

Virtual environments affected

  • [ ] macOS 10.15
  • [ ] Ubuntu 16.04 LTS
  • [ ] Ubuntu 18.04 LTS
  • [ x ] Windows Server 2016 R2
  • [ x ] Windows Server 2019

Expected behavior
The pagefile size should be increased to a more reasonable value for a modern system.

Actual behavior
The issue can be reproduced by forking my repo and running the build:
https://github.com/38leinaD/quarkus-with-gh-actions/runs/620081929?check_suite_focus=true

Java Windows bug needs eyes

Most helpful comment

Hello, @38leinaD
Good news, @maxim-lobanov has created a wrapper configure-pagefile-action task. Feel free to use in your pipeline.

E.g.

- name: configure Pagefile
   uses: al-cheb/[email protected]
- name:
   run: |
        (Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize

page - Copy

All 5 comments

Hello, @38leinaD
I can reproduce the issue. It's very difficult to change pagefile size from our side. Could you please use a workaround and change pagesize at runtime?

- name: SetPageFile
      run: |
        Invoke-WebRequest http://www.paraglidernc.com/Files/SetPageFile1008.cab -OutFile SetPageFile1008.cab
        expand.exe SetPageFile1008.cab -F:* C:\
        C:\files\SetPageFile.exe /f D:\pagefile.sys /m 8192
    - name: Build Gradle
      run: |
        call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
        gradlew build -x check -Dquarkus.package.type=native

pagesize - Copy

Awesome! This works. I was under the impression that the pagefile size cannot be changed without a restart of the system.
What is the recommendation going forward? Is it safe to rely on the WebRequest to download this file (what is this tool anyway?) and will it be there the forseeable future?

@38leinaD,
We have been discussing the possibility of changing PageFile size on Windows image or preparing non-official GitHub Action task. I have written a powershell script that allow to change PageFile size without reboot - https://raw.githubusercontent.com/al-cheb/PageFile/master/SetPageFileSize.ps1 if you would like to replace the SetPageFile.exe util.

- name: SetPageFile
  run: |
     Invoke-Expression ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/al-cheb/PageFile/master/SetPageFileSize.ps1'))
  shell: powershell

thanks for the workaround @al-cheb! @38leinaD I don't think we can easily increase the current pagefile size without significantly impacting a lot of jobs since it would eat into the available space in the temp drive of the VM. I'll close this for now, it's not something we are planning to change at the time, please reopen if you wish to discuss further. Thanks for reaching out!

Hello, @38leinaD
Good news, @maxim-lobanov has created a wrapper configure-pagefile-action task. Feel free to use in your pipeline.

E.g.

- name: configure Pagefile
   uses: al-cheb/[email protected]
- name:
   run: |
        (Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize

page - Copy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mxschmitt picture mxschmitt  路  3Comments

mcooley picture mcooley  路  3Comments

ydnar picture ydnar  路  3Comments

adamsiembida picture adamsiembida  路  3Comments

raulpopadineti picture raulpopadineti  路  3Comments