Skip to content

Metaspace leak during indexing #8702

@mbien

Description

@mbien

Apache NetBeans version

Apache NetBeans 27 latest release candidate

What happened

A smoke test which I run during each release which opens all ~800 NB modules and lets NB index them found a potential classloader leak. (but I don't think this is a regression)

Metaspace grows during indexing, closing projects or GC does not free it afterwards.

looks like this once all projects indexed:

Image

setting -J-Djava.source.aptutils.disable.classloader.cache=true does seem to help and GC appears to free resources again, but this might be only part of the story.

Image

Language / Project Type / NetBeans Component

No response

How to reproduce

set -e

# opens all netbeans modules as code scanner smoke test

# 1) build netbeans and change netbeans project JDK to "default"
# 2) run script in netbeans project

NB="/path/to/extracted/zip"
JDK="/home/mbien/dev/java/jdk-25-ea_b32"

OPEN=$(find -maxdepth 2 -mindepth 2 -type d\
 -not -path "./.git*"\
 -not -path "./nbbuild/*"\
 -not -path "./dist/*"\
 -not -path "./ide/xml.core"\
 -not -path "./nbi/*" | sort | xargs)

#-J-Djava.source.aptutils.disable.classloader.cache=true

FLAGS="-J-Dorg.netbeans.modules.parsing.impl.indexing.LogContext\$EventType.PATH.treshold=20"

"$NB/bin/netbeans" --userdir /tmp/nbusr$$ --jdkhome $JDK $FLAGS $OPEN

Did this work correctly in an earlier version?

No / Don't know

Operating System

linux

JDK

25

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

Maybe but not soon

Metadata

Metadata

Assignees

No one assigned

    Labels

    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:bugBug report or fixperformance

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions