cloud-fan commented on code in PR #37834:
URL: https://github.com/apache/spark/pull/37834#discussion_r969145075


##########
core/src/main/java/org/apache/spark/memory/MemoryConsumer.java:
##########
@@ -154,8 +156,10 @@ private void throwOom(final MemoryBlock page, final long 
required) {
     }
     taskMemoryManager.showMemoryUsage();
     // checkstyle.off: RegexpSinglelineJava
-    throw new SparkOutOfMemoryError("UNABLE_TO_ACQUIRE_MEMORY",
-            new String[]{Long.toString(required), Long.toString(got)});
+    Map<String, String> params = new HashMap<String, String>();
+    params.put("requestedBytes", Long.toString(required));
+    params.put("receivedBytes", Long.toString(got));
+    throw new SparkOutOfMemoryError("UNABLE_TO_ACQUIRE_MEMORY", params);

Review Comment:
   shall we move it to `SparkCoreErrors`? Then we don't need to create a map in 
Java.



-- 
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