### CI Link

https://gradle-enterprise.elastic.co/s/znzaabr7xk2nq

### Repro line
```
./gradlew ':x-pack:plugin:ml:test' --tests "org.elasticsearch.xpack.ml.utils.NativeMemoryCalculatorTests.testActualNodeSizeCalculationConsistency" -Dtests.seed=A70DC496F83A52CF
```

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

```java
org.elasticsearch.xpack.ml.utils.NativeMemoryCalculatorTests > testActualNodeSizeCalculationConsistency FAILED
    java.lang.AssertionError: native memory [113246208] smaller than original native memory [113669306]
    Expected: a value equal to or greater than <113669305L>
         but: <113246208L> was less than <113669305L>
        at __randomizedtesting.SeedInfo.seed([A70DC496F83A52CF:8204CD95D7187768]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.junit.Assert.assertThat(Assert.java:956)
        at org.elasticsearch.xpack.ml.utils.NativeMemoryCalculatorTests.lambda$testActualNodeSizeCalculationConsistency$0(NativeMemoryCalculatorTests.java:170)
        at org.elasticsearch.xpack.ml.utils.NativeMemoryCalculatorTests.testActualNodeSizeCalculationConsistency(NativeMemoryCalculatorTests.java:207)
```

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/NativeMemoryCalculator.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */
package org.elasticsearch.xpack.ml.utils;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.xpack.core.ml.MachineLearningField;
import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig;
import org.elasticsearch.xpack.core.ml.job.config.Job;
import org.elasticsearch.xpack.ml.MachineLearning;
import java.util.OptionalLong;
import static org.elasticsearch.xpack.ml.MachineLearning.MACHINE_MEMORY_NODE_ATTR;
import static org.elasticsearch.xpack.ml.MachineLearning.MAX_JVM_SIZE_NODE_ATTR;
import static org.elasticsearch.xpack.ml.MachineLearning.MAX_LAZY_ML_NODES;
import static org.elasticsearch.xpack.ml.MachineLearning.MAX_MACHINE_MEMORY_PERCENT;
import static org.elasticsearch.xpack.ml.MachineLearning.MAX_ML_NODE_SIZE;
import static org.elasticsearch.xpack.ml.MachineLearning.USE_AUTO_MACHINE_MEMORY_PERCENT;
public final class NativeMemoryCalculator {