Randomized sample interval
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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