sarutak commented on a change in pull request #30920:
URL: https://github.com/apache/spark/pull/30920#discussion_r550108137



##########
File path: core/src/main/resources/org/apache/spark/ui/static/executorspage.js
##########
@@ -414,38 +414,74 @@ $(document).ready(function () {
                         },
                         {
                             data: function (row, type) {
-                                if (type !== 'display')
-                                    return row.peakMemoryMetrics.JVMHeapMemory;
-                                else
-                                    return 
(formatBytes(row.peakMemoryMetrics.JVMHeapMemory, type) + ' / ' +
-                                        
formatBytes(row.peakMemoryMetrics.JVMOffHeapMemory, type));
+                                var peakMemoryMetrics = row.peakMemoryMetrics;
+                                if (typeof peakMemoryMetrics !== 'undefined') {
+                                    if (type !== 'display')
+                                        return peakMemoryMetrics.JVMHeapMemory;
+                                    else
+                                        return 
(formatBytes(peakMemoryMetrics.JVMHeapMemory, type) + ' / ' +
+                                            
formatBytes(peakMemoryMetrics.JVMOffHeapMemory, type));
+                                } else {
+                                    if (type !== 'display') {
+                                        return 0;

Review comment:
       Yes, that returns 0 but I wonder it's impossible for us to tell that 
"the metrics is not updated yet" from "that the metrics is actually 0".




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

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