Avatar for the oxc-project user
oxc-project
oxc-resolver
BlogDocsChangelog

Branches performance

Pull requests

fix: use `Weak` references for `CachedPath` to enable proper drop#727
last run
14 hours ago
fix: use `Weak` references for `CachedPath` to enable proper drop (#727) Related: * https://github.com/oxc-project/oxc/issues/10627 The resolver was experiencing memory leaks due to circular strong references between `CachedPath` objects. Even after the resolver was dropped, `CachedPath` instances (and their associated `PackageJson` data) remained in memory due to reference cycles created by Arc (reference-counted) pointers. The memory leak was caused by circular references in three fields of `CachedPathImpl`: 1. `parent: Option<CachedPath>` - Child paths held strong references to parent paths 2. `canonicalized: OnceLock<Result<CachedPath, ResolveError>>` - Paths held strong references to their canonicalized versions 3. `node_modules: OnceLock<Option<CachedPath>>` - Parent directories held strong references to their node_modules subdirectories These created reference cycles preventing Arc reference counts from reaching zero. Converted all fields that could create circular references to use `Weak` references: - `parent: Option<Weak<CachedPathImpl>>` - `canonicalized: OnceLock<Result<Weak<CachedPathImpl>, ResolveError>>` - `node_modules: OnceLock<Option<Weak<CachedPathImpl>>>` Updated all accessor methods to upgrade Weak references when needed: - `parent()` - Upgrades weak parent reference - `cached_node_modules()` - Stores and retrieves weak references - `canonicalize_impl()` - Stores canonicalized paths as weak references Passes `test_memory_leak_arc_cycles` that failed in the previous stack.
14 hours ago
bc9c219
09-23-fix_use_weak_references_for_cachedpath_to_enable_proper_drop
CodSpeed Performance Gauge
+11%
fix: memory never being freed with a self-referential Arc clone
17 hours ago
e4821df
09-23-fix_memory_never_being_freed_with_a_self-referential_arc_clone
CodSpeed Performance Gauge
+1%
chore(deps): lock file maintenance rust crates
2 days ago
e05a19f
renovate/rust-crates
CodSpeed Performance Gauge
0%
chore(deps): update npm packages
1 year ago
effd080
renovate/npm-packages
CodSpeed Performance Gauge
0%
© 2025 CodSpeed Technology
Home Terms Privacy Docs