Skip to content

fix: improve memory estimates on Windows and macOS - #2583

Open
stack-rishi wants to merge 1 commit into
apify:masterfrom
stack-rishi:fix/windows-memory-estimate
Open

stack-rishi wants to merge 1 commit into
apify:masterfrom
stack-rishi:fix/windows-memory-estimate

Conversation

@stack-rishi

@stack-rishi stack-rishi commented Dec 3, 2026 •

Copy link
Copy Markdown

Description

On Windows and macOS, Crawlee adds up the resident memory of the crawler
and its child processes. If several processes map the same memory, that
sum counts the shared pages more than once.

On Windows, the estimate now counts private pages in full and divides
shared pages by their reported share count. On macOS, it uses Apple's
process memory footprint, which excludes clean mappings such as shared
libraries. Both paths fall back to RSS if the new reading is unavailable.

Issues

Fixes #1234.

Testing

  • Windows: 99 tests passed and 9 were skipped. In a 48 MiB shared-memory
    test, the extra memory counted dropped from 48.1 MiB to 6.9 MiB.
  • Intel macOS with Python 3.13: 96 tests passed and 12 were skipped.
    Mapping the same 48 MiB in the child increased its RSS by 48.0 MiB.
    Crawlee's estimate for the process tree stayed unchanged.
    macOS CI run

Checklist

  • Upstream CI passed

Copilot AI balanced review requested due to automatic review settings December 3, 2026 19:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve used memory estimation when running locally on Windows or Mac

2 participants