zhli1142015 commented on code in PR #9062:
URL: https://github.com/apache/incubator-gluten/pull/9062#discussion_r2007325251


##########
gluten-core/src/main/java/org/apache/gluten/memory/memtarget/DynamicOffHeapSizingMemoryTarget.java:
##########
@@ -30,7 +31,19 @@ public class DynamicOffHeapSizingMemoryTarget implements 
MemoryTarget {
   private final MemoryTarget delegated;
   // When dynamic off-heap sizing is enabled, the off-heap should be sized for 
the total usable
   // memory, so we can use it as the max memory we will use.
-  private static final long MAX_MEMORY_IN_BYTES = 
GlutenConfig.get().offHeapMemorySize();
+  private static final long MAX_MEMORY_IN_BYTES;
+
+  static {
+    SparkEnv sparkEnv = SparkEnv.get();
+    if (sparkEnv != null && sparkEnv.conf() != null) {

Review Comment:
   Do we need to check if SparkEnv.get is null?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to