orpiske commented on code in PR #24488:
URL: https://github.com/apache/camel/pull/24488#discussion_r3534951798


##########
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:
   Hm, relying non monotonic clocks could be problematic. I think the 
`Thread.sleep` is safer in this case.



-- 
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]

Reply via email to