You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/07/29 13:50:08 UTC
[I] [maven-4.0.x] DefaultDependencyResolver: unbounded per-instance module caches [maven]
elharo opened a new issue, #12606:
URL: https://github.com/apache/maven/issues/12606
# DefaultDependencyResolver: Unbounded per-instance module caches
**Found in:** maven-4.0.x branch
**File:** `impl/maven-impl/src/main/java/org/apache/maven/impl/resolver/DefaultDependencyResolver.java` (lines 81, 86-89, 97-98)
**Severity:** Medium
## Description
The class is `@Singleton` but the `moduleCaches` map holds `PathModularizationCache` instances that are never cleaned up:
```java
private final Map<Runtime.Version, PathModularizationCache> moduleCaches;
public DefaultDependencyResolver() {
moduleCaches = new ConcurrentHashMap<>();
}
```
Each unique `Runtime.Version` creates a new cache entry that stays in memory for the lifetime of the JVM. The TODOs on lines 78 and 87 acknowledge this should be session-wide. This is a memory leak in long-running build environments (e.g., Maven in server mode, IDE integration).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [maven-4.0.x] DefaultDependencyResolver: unbounded per-instance module caches [maven]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on issue #12606:
URL: https://github.com/apache/maven/issues/12606#issuecomment-5133273472
It's not obvious that there are or ever will be enough different unique Runtime.Versions to make this remotely relevant.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [maven-4.0.x] DefaultDependencyResolver: unbounded per-instance module caches [maven]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo closed issue #12606: [maven-4.0.x] DefaultDependencyResolver: unbounded per-instance module caches
URL: https://github.com/apache/maven/issues/12606
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org