oracle / oracle/visualvm

Randomized sample interval

Open
#195 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
3.3k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
In certain applications, the part of code that is measured runs at very regular intervals, followed by a call to sleep(). In those cases, the sample interval will end up always hitting the same time along the code almost every time, causing severe misreporting of time spent in particular sections of code.

In more severe cases, I got it to report 100% time spent in sleep() and all other code never showed up, when it should have been around 94% in sleep() and 6% in other code.

Describe the solution you'd like
A randomized sample interval. To solve this problem temporarily, I made my own custom build but it's not a good solution and I'm not sure if it has any bad side effects.

Describe alternatives you've considered
Profiler is not a viable alternative as it causes too massive slowdowns and sometimes instability.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating VisualVM's sampling interval implementation and the entry point that schedules samples. Reproduce the regular-interval bias described with code that repeatedly sleeps, then verify that randomized sampling avoids reporting all time in sleep without introducing instability.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.