gnodet commented on code in PR #24488:
URL: https://github.com/apache/camel/pull/24488#discussion_r3536753194
##########
core/camel-console/src/main/java/org/apache/camel/impl/console/JfrMemoryLeakDevConsole.java:
##########
@@ -137,7 +137,11 @@ private synchronized JsonObject doStart(Map<String,
Object> options) {
// trigger GC before starting to establish a cleaner baseline
System.gc();
try {
- Thread.sleep(500);
+ long deadline = System.currentTimeMillis() + 500;
+ long remaining;
+ while ((remaining = deadline - System.currentTimeMillis()) >
0) {
+ wait(remaining);
+ }
Review Comment:
Good catch — switched to Camel's `StopWatch` (backed by `System.nanoTime()`,
monotonic) instead of `System.currentTimeMillis()` to avoid clock drift issues.
Fixed in 859b1e0.
_Claude Code on behalf of gnodet_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]