Skip to content

Bug 2091167 - SizeLimit plugin parses all of /proc/self/smaps in pure Perl after every request (~3 ms per request) - #2822

Open
dklawren wants to merge 1 commit into
mozilla:masterfrom
dklawren:2091167
Open

dklawren wants to merge 1 commit into
mozilla:masterfrom
dklawren:2091167

Conversation

@dklawren

@dklawren dklawren commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

… Perl after every request (~3 ms per request)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the SizeLimit memory-check optimization.

No open issues 🎉

What changed in this PR

This PR reduces per-request memory-check overhead in the SizeLimit plugin by reading VmSize from /proc/self/status instead of parsing /proc/self/smaps.

Changes:

  • Replaces smaps parsing with a lightweight virtual-memory-size reader while preserving the worker shutdown threshold.
  • Removes the Linux::Smaps::Tiny dependency.
  • Adds tests for memory-size reading, threshold behavior, and unavailable measurements.
File Description
t/​app-size-limit.t Tests memory readings and worker shutdown behavior.
Makefile.PL Removes Linux::Smaps::Tiny from optional prerequisites, retaining BSD::Resource.
cpanfile Removes the Linux::Smaps::Tiny dependency.
Bugzilla/​App/​Plugin/​SizeLimit.pm Reads VmSize from proc status for per-request memory checks.

Review effort: Balanced

@dklawren
dklawren requested review from Xzzz and cgsheeh November 10, 2026 00:05

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants