Error: "The paging file is too small for this operation to complete"

I got the error when a task is trying to natively allocate 245MB memory (mmap).

Is there any configuration to increase the paging file size?

2 Likes

According to your logs, There is insufficient memory for the Java Runtime Environment to continue.

There is the Github hosted runner virtual machine’s hardware resources:

  • 2-core CPU
  • 7 GB of RAM memory
  • 14 GB of SSD disk space

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources

Is it enough to run your Test step in windows runner?

You can set up aself-hosted runner in your local windows machine , use it run your workflow, check whether the workflow could complete without insufficient memory error?

1 Like

Thank you for your reply.

I’m not sure that the insufficient memory is caused by the overall 7GB memory limit in the hosted vm or because of the paging file size is insufficient as the error message indicates.

The same task ran successfully in a different CI hosting provider, which has a similar memory configuration (6-7.5GB) to GitHub hosted vm’s (it could be that the task was run in a vm with 7.5GB memory which made a difference).

Anyway, based on the link that you provided, self-hosted runners should not be used for public repos due to some potential security issues, so that does not seem to be a good option here.

For us to reproduce and investigate your issue further, is it possible to provide your project and workflow yml file to me? 

And can you build a smaller size native app? Will a smaller one still meet this error?

Thank you for willing to investigate the issue further.

I have created a branch in the repo (action-paging) with the appropriate workflow to reproduce the issue.

As can be observed in the last CI run of the branch, the task on a small app succeded.  Like before, however, it failed on the larger one.

Thank you for your detail info. I have involved some senior Github engineers into this issue. It will take some time for them to investigate it. You patience will be needed. 

1 Like

I’ve investigated this issue and the problem is that Windows decides to create a single page file on the D:\ drive, which has only 14 GB, and by default it allocates only 1/8th of the volume size, or about 1.75 GB. This is a very small page file by modern standards and many applications will fail. I’ve thought about increasing its size with the following commands:

wmic pagefileset create name="D:\pagefile.sys"
wmic pagefileset where "name='D:\\pagefile.sys'" set InitialSize=8192,MaximumSize=8192
wmic pagefileset list /format:list
echo "Restarting machine"
sleep 5
restart-computer -f
sleep 5
wmic pagefile list /format:list

Unfortunately, it’s not possible to change the settings of the page file without restarting the machine, and PowerShell commands like restart-computer do not seem to work in the windows-latest environment either. Would it be possible either to update the environment with a larger page file by default or to allow us to reboot the machines?

I am also seeing this error now when building a graalvm native image on a windows-2019 runner.

@robby-phd How did you resolve the issue for your repo? As it seems you CI-builds under windows are now running fine.

Hi,

@yanjingzhu What is the status on this issue?

Thanks,
Daniel

Hi @38leinad , 

The issue is more related to the Github hosted VM , the best thing to do is to file an issue at https://github.com/actions/virtual-environments. Thank you for your understanding.  

@38leinad I disabled the failing test in GitHub Action until the paging issue is resolved.

Hello, @robby-phd
We have created a configure-pagefile-action  actions - https://github.com/actions/virtual-environments/issues/785#issuecomment-625705010

- name: configure Pagefile
  uses: al-cheb/configure-pagefile-action@v1.2
- name:
   run: |
        (Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize

81387392-42dcc600-911f-11ea-8c32-d31f0fac570b

4 Likes

@al-chebThanks for letting me know. The configure-pagefile action works for me.

Thank you @al-cheb. That was really useful.