GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: move join/dirname caches to Resolver instance to prevent memory leak by xiaoxiaojx · Pull Request #507 · webpack/enhanced-resolve

Conversation

@xiaoxiaojx

@xiaoxiaojx xiaoxiaojx commented Apr 5, 2026

Copy link
Copy Markdown
Member

Summary
fixes #414

What kind of change does this PR introduce?
fix

Did you add tests for your changes?
Existing

Does this PR introduce a breaking change?
No

If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing

Use of AI
Partial

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@changeset-bot

changeset-bot Bot commented Apr 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b0e639

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
enhanced-resolve Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: alexander-akait / name: alexander-akait (3b0e639, a8f0466, d81cbe9)
  • ✅ login: xiaoxiaojx / name: xiaoxiaojx (7c09741, ca39d4e, cc32ed4, eb437ea, f0fae12)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Apr 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.50%. Comparing base (cdae279) to head (3b0e639).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/Resolver.js 84.61% 2 Missing ⚠️
lib/TsconfigPathsPlugin.js 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #507      +/-   ##
==========================================
+ Coverage   93.42%   93.50%   +0.07%     
==========================================
  Files          50       50              
  Lines        2525     2555      +30     
  Branches      773      779       +6     
==========================================
+ Hits         2359     2389      +30     
  Misses        137      137              
  Partials       29       29              
Flag Coverage Δ
integration 93.50% <96.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@xiaoxiaojx
xiaoxiaojx marked this pull request as draft April 5, 2026 12:58
@xiaoxiaojx
xiaoxiaojx force-pushed the fix/join-cache-memory-leak branch from 724f707 to fd07044 Compare April 5, 2026 13:12
@xiaoxiaojx
xiaoxiaojx marked this pull request as ready for review April 5, 2026 13:35
alexander-akait
alexander-akait reviewed Apr 14, 2026
View reviewed changes
Comment thread lib/Resolver.js Outdated
constructor(fileSystem, options) {
this.fileSystem = fileSystem;
this.options = options;
if (options.unsafeCache) {

@alexander-akait alexander-akait Apr 14, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@xiaoxiaojx I think we will have a perf regression here, before we always cache path operations, now we are doing it only when unsafeCache is enabled

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@xiaoxiaojx xiaoxiaojx Apr 14, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yeah, here I’m thinking of leveraging the unsafeCache option as much as possible. I’ll run the new benchmark just added and see how it performs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@xiaoxiaojx xiaoxiaojx Apr 14, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Two performance regressions — I’ll fix them. 😂
image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@xiaoxiaojx
xiaoxiaojx force-pushed the fix/join-cache-memory-leak branch from fd07044 to 115db10 Compare April 14, 2026 16:41
@codspeed

codspeed Bot commented Apr 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Merging this PR will improve performance by 31.23%

⚡ 2 improved benchmarks
✅ 41 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ alias-field: browser field (warm) 2 ms 1.5 ms +31.23%
⚡ symlinks: follow symlinks=true (warm) 1.8 ms 1.6 ms +12.6%

Comparing fix/join-cache-memory-leak (3b0e639) with main (cdae279)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexander-akait
alexander-akait reviewed Apr 14, 2026
View reviewed changes
Comment thread lib/Resolver.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

xiaoxiaojx added 5 commits April 15, 2026 14:52
@xiaoxiaojx @alexander-akait
fix: move join/dirname caches to Resolver instance to prevent memory …
7c09741
…leak
@xiaoxiaojx @alexander-akait
fix: update
eb437ea
@xiaoxiaojx @alexander-akait
fix: update
cc32ed4
@xiaoxiaojx @alexander-akait
fix: update
f0fae12
@xiaoxiaojx @alexander-akait
fix: update
ca39d4e
@alexander-akait
alexander-akait force-pushed the fix/join-cache-memory-leak branch from b6719b2 to ca39d4e Compare April 15, 2026 11:52
alexander-akait added 3 commits April 15, 2026 15:50
@alexander-akait
feat: basename cache + refactor
d81cbe9
@alexander-akait
test: fix
a8f0466
@alexander-akait
test: more
3b0e639
@alexander-akait
alexander-akait merged commit ba9a8e2 into main Apr 15, 2026
32 of 33 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait deleted the fix/join-cache-memory-leak branch April 15, 2026 13:42
@github-actions github-actions Bot mentioned this pull request Apr 14, 2026
chore(release): new release #496
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alexander-akait alexander-akait alexander-akait left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

pathUtils | joinCache memory leak

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@xiaoxiaojx @alexander-akait
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.