diff --git a/core/src/main/scala/org/apache/spark/util/SizeEstimator.scala b/core/src/main/scala/org/apache/spark/util/SizeEstimator.scala index 65c32b51eed2a..e09f1fc16f6f3 100644 --- a/core/src/main/scala/org/apache/spark/util/SizeEstimator.scala +++ b/core/src/main/scala/org/apache/spark/util/SizeEstimator.scala @@ -132,8 +132,8 @@ object SizeEstimator extends Logging { } // java.vm.info provides compressed ref info for IBM and OpenJ9 JDKs - if (System.getProperty("java.vendor").contains("IBM") || - System.getProperty("java.vendor").contains("OpenJ9")) { + val javaVendor = System.getProperty("java.vendor") + if (javaVendor.contains("IBM") || javaVendor.contains("OpenJ9")) { return System.getProperty("java.vm.info").contains("Compressed Ref") }