Skip to content

Large quantities of virtual threads may cause JFR performance issues #9536

@roberttoyonaga

Description

@roberttoyonaga

Describe the issue
In SubstrateVM, JFR eagerly registers virtual threads when they are mounted and during a chunk rotation. This means large numbers of virtual threads will result in a lot of work, even if the threads don't end up emitting any events. In Hotspot, virtual threads are registered lazily upon event emission.

Steps to reproduce the issue

  • Create a large number of virtual threads
  • Configure JFR to emit fewer events.

Describe GraalVM and your environment:
The problem is in the latest GraalVM master and all previous versions that support virtual threads in JFR.

Solution
Adopt a lazy approach to registration similar to Hotspot.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions