We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f90566a commit 08736f4Copy full SHA for 08736f4
src/jdk.management/macosx/native/libmanagement_ext/UnixOperatingSystem.c
@@ -1,5 +1,5 @@
1
/*
2
- * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
@@ -63,6 +63,9 @@ Java_com_sun_management_internal_OperatingSystemImpl_getCpuLoad0
63
64
jlong used_delta = used - last_used;
65
jlong total_delta = total - last_total;
66
+ if (total_delta == 0) {
67
+ return 0;
68
+ }
69
70
jdouble cpu = (jdouble) used_delta / total_delta;
71
0 commit comments