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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]