A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/2911 below:

[java] ClassTypeResolver#searchNodeNameForClass leaks memory · Issue #2911 · pmd/pmd · GitHub

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:

  1. Set a conditional breakpoint in ClassLoader#getClassLoadingLock with condition className.contains(".get")
  2. Start a debug configuration listening on port 5005
  3. Run 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