File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/jdk.management/unix/classes/com/sun/management/internal Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2003, 2021 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2003, 2022 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,8 @@ public double getContainerCpuLoad() {
9393 int totalCPUs = getHostOnlineCpuCount0 ();
9494 int containerCPUs = getAvailableProcessors ();
9595 // scale the total host load to the actual container cpus
96- hostTicks = hostTicks * containerCPUs / totalCPUs ;
96+ double scaleFactor = ((double ) containerCPUs ) / totalCPUs ;
97+ hostTicks = (long ) (hostTicks * scaleFactor );
9798 return getUsageDividesTotal (cpuUsageSupplier ().getAsLong (), hostTicks );
9899 } else {
99100 // If CPU quotas and shares are not active then find the average load for
You can’t perform that action at this time.
0 commit comments