CodeQL out of memory

I saw the new blog post about code scanning and tried to turn it on for a large framework in .NET that I help maintain. I had to switch the action to run on Windows so that the compile would work (there were missing files on the Linux build, which didn’t make sense). On the Windows run, the C# runner ran out of memory:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000007e2300000, 200278016, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 200278016 bytes for Failed to commit area from 0x00000007e2300000 to 0x00000007ee200000 of length 200278016.
# An error report file with more information is saved as:
# D:\a\Dnn.Platform\Dnn.Platform\hs_err_pid6332.log
Error: Error running analysis for csharp: Error: The process 'C:\hostedtoolcache\windows\CodeQL\0.0.0-20200826\x64\codeql\codeql.exe' failed with exit code 1
Error: The process 'C:\hostedtoolcache\windows\CodeQL\0.0.0-20200826\x64\codeql\codeql.exe' failed with exit code 1
Error: No SARIF files found to upload in "../results".

The full run is available at https://github.com/bdukes/Dnn.Platform/runs/1193734099

1 Like

@bdukes,

I have created an issue ticket (github/codeql-action#245) to help you report the problem to the appropriate engineering team for further investigation and evaluation.

You can follow this issue ticket and add your comments to it.

1 Like

I am having this issue as well. https://github.com/bvcms/bvcms/runs/1199631078?check_suite_focus=true

Perhaps changing the size of PageFile will help:

Set default size to 8GB:

- name: configure Pagefile
  uses: al-cheb/configure-pagefile-action@v1.2

Set default size to 32GB:

- name: configure Pagefile
  uses: al-cheb/configure-pagefile-action@v1.2
  with:
      minimum-size: 32GB
      maximum-size: 32GB
      disk-root: "C:"
1 Like

I forgot that the CodeQL action was also running on a scheduled basis. So of the first five runs, there were two that succeeded, so this project, at least, must be close to that memory limit.

I used the 32GB example, and got an error earlier in the process that the disk was out of space. I then changed it to 8-32GB and put the page file on D: and that seemed to have consistently resolved the memory issue.

    - name: configure Pagefile
      uses: al-cheb/configure-pagefile-action@v1.2
      with:
          minimum-size: 8GB
          maximum-size: 32GB
          disk-root: "D:"