Affects PMD Version:
6.29.0
Description:
ClassTypeResolver#searchNodeNameForClass
does many more ClassLoader.loadClass()
calls than there are classes in the project. Because the looked up names do not exist, the calls go through all the classloaders in the hierarchy, and every classloader creates an entry for the name in its parallelLockMap
.
In turn, JavaTypeDefinition#CLASS_EXACT_TYPE_DEF_CACHE
holds references to the types that do exist in the project, which keep alive the classloaders of all the modules in the Maven reactor, along with their parallelLockMap
.
Steps to reproduce:
ClassLoader#getClassLoadingLock
with condition className.contains(".get")
MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=localhost:5006" mvn pmd:pmd
Running PMD through: Maven
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4