mandrel: add fallback when memory detection fails (e.g. on aarch64).

This commit is contained in:
Leah Neukirchen 2021-07-16 11:32:49 +00:00
parent 6b82f6a250
commit c38ebffb3d

View file

@ -0,0 +1,12 @@
--- a/mandrel-mandrel-21.1.0.0-Final/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
+++ b/mandrel-mandrel-21.1.0.0-Final/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
@@ -1829,6 +1829,9 @@
if (Long.compareUnsigned(memMax, SubstrateOptionsParser.parseLong(maxXmx)) >= 0) {
return maxXmx;
}
+ if (memMax == 0) {
+ return "2g";
+ }
return Long.toUnsignedString(memMax);
}