Skip to content

Self-Hosted Github actions runner listener uses huge amount of virtual memory when idle #3796

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

Open
td-jszpunar opened this issue Apr 8, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@td-jszpunar
Copy link

td-jszpunar commented Apr 8, 2025

Describe the bug
I’m running into a strange issue with my self-hosted GitHub Actions runner where the listener process is using an enormous amount of virtual memory—around 700GB—even when it’s idle and no workflows are running. This is causing problems on my private VPS, as other applications are being terminated due to insufficient swap space.

What's not working?

Enormous VMEM usage - is possible to limit the VMEM usage for runner? Is there config somewhere where I could specify max usage for virtual memory?
image

Main part of the workflow used for building the docker images and running the containers:

jobs:
  deploy:
    runs-on: self-hosted

    steps:
      - name: Add GitHub to the SSH known hosts file
        run: |
          [...]

      - name: Collect Git and SSH config files in a directory that is part of the Docker build context
        run: |
          mkdir root-config
          cp -r ~/.gitconfig  ~/.ssh root-config/

      - name: Stop and Remove Existing Container (if running)
        run: |
          docker stop app-test || true
          docker rm app-test || true

      - name: Remove Old Docker Image (if exists)
        run: |
          docker rmi app:test || true

      - name: Build docker image
        run: |
          docker build -f test.dockerfile -t app:test  --ssh default=${{ env.SSH_AUTH_SOCK }}  .

      - name: Run the container
        run: |
          docker run \
                -e LOG_DIR=/home/app/logs \
                -e WORK_DIR=/home/app \
                --cpus="8.0" \
                --memory="100g" \
                -d \
                --name app-test \
                app:test

Runner Version and Platform

Current runner version: '2.322.0'
Ubuntu 24.04.1 LTS

  • I’m running the self-hosted runner directly on a private VPS with Ubuntu 20.04. This machine has 346 GB of RAM
  • The runner is set up to process workflows for my repositories (building Docker containers of app), but this high memory usage happens even when no jobs are active.
  • When I check with htop, the VIRT (virtual memory) for the listener process shows ~700GB, while the RES (physical memory) stays low, below 100 MB.
  • I tried using ulimit -v, but after setting it to 1 GB (or even 50gb) it won't start the runner (./run.sh)
devops-user:~/actions-runner$ ./run.sh
GC heap initialization failed with error 0x8007000E
Failed to create CoreCLR, HRESULT: 0x8007000E
Exiting with unknown error code: 137
Exiting runner...
@td-jszpunar td-jszpunar added the bug Something isn't working label Apr 8, 2025
@akuzminsky
Copy link

  14620 github-run  20   0  261G  144M 91860 S   0.0  0.9  0:02.38 /tmp/actions-runner-linux/bin/Runner.Listener run

Mine is actions-runner-linux-x64-2.323.0.tar.gz and instance lifetime is limited to 5 days. No problems with swap though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants