Skip to content

Reduce thread count on 32-bit in GetTotalAllocatedBytes.TestAnotherThread#127583

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-get-total-allocated-bytes-test
Open

Reduce thread count on 32-bit in GetTotalAllocatedBytes.TestAnotherThread#127583
Copilot wants to merge 2 commits intomainfrom
copilot/fix-get-total-allocated-bytes-test

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

GC/API/GC/GetTotalAllocatedBytes intermittently fails with OutOfMemoryException on linux-arm Checked jitstress: rapidly creating 1000 threads exhausts the 32-bit address space.

Changes

  • src/tests/GC/API/GC/GetTotalAllocatedBytes.cs
    • TestAnotherThread: cap the inner thread-creation loop at 100 on 32-bit (IntPtr.Size == 4); 64-bit keeps the original 1000.
    • Remove the [ActiveIssue(..., IsArm)] suppression so the test runs on 32-bit ARM again.
// 1000 quickly created threads can be too many for a 32-bit environment, so reduce on 32-bit.
int threadCount = IntPtr.Size == 4 ? 100 : 1000;

tsk = Task.Run(() => {
    for (int i = 0; i < threadCount; i++)
    {
        ...
    }
});

Note

This PR description and the contained changes were generated with assistance from GitHub Copilot.

Copilot AI requested review from Copilot and removed request for Copilot April 29, 2026 20:58
…nd re-enable on Arm

Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/387e1f63-2703-4397-926b-29c580094fd8

Co-authored-by: VSadov <8218165+VSadov@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 29, 2026 21:02
Copilot AI changed the title [WIP] Fix test failure in GetTotalAllocatedBytes.cmd Reduce thread count on 32-bit in GetTotalAllocatedBytes.TestAnotherThread Apr 29, 2026
Copilot AI requested a review from VSadov April 29, 2026 21:03
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/gc
See info in area-owners.md if you want to be subscribed.

@VSadov VSadov requested a review from janvorli April 29, 2026 22:46
@VSadov VSadov marked this pull request as ready for review April 30, 2026 00:36
Copilot AI review requested due to automatic review settings April 30, 2026 00:36
@VSadov VSadov enabled auto-merge (squash) April 30, 2026 00:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reduces intermittent OutOfMemoryException failures in the GC/API/GC/GetTotalAllocatedBytes test on 32-bit Linux ARM by lowering the amount of thread creation pressure, and re-enables the test on ARM by removing an ActiveIssue suppression.

Changes:

  • Cap the thread-creation loop in TestAnotherThread to 100 iterations on 32-bit processes (keep 1000 on 64-bit).
  • Remove the ARM-specific [ActiveIssue(... IsArm)] suppression so the test runs on ARM again.

Comment thread src/tests/GC/API/GC/GetTotalAllocatedBytes.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure: GC/API/GC/GetTotalAllocatedBytes/GetTotalAllocatedBytes.cmd

5 participants