Github user ankuriitg commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21916#discussion_r206269773
  
    --- Diff: core/src/main/scala/org/apache/spark/memory/MemoryManager.scala 
---
    @@ -180,6 +181,34 @@ private[spark] abstract class MemoryManager(
         onHeapStorageMemoryPool.memoryUsed + 
offHeapStorageMemoryPool.memoryUsed
       }
     
    +  /**
    +   *  On heap execution memory currently in use, in bytes.
    +   */
    +  final def onHeapExecutionMemoryUsed: Long = 
onHeapExecutionMemoryPool.memoryUsed
    +
    +  /**
    +   *  Off heap execution memory currently in use, in bytes.
    +   */
    +  final def offHeapExecutionMemoryUsed: Long = 
offHeapExecutionMemoryPool.memoryUsed
    +
    +  /**
    +   *  On heap storage memory currently in use, in bytes.
    +   */
    +  final def onHeapStorageMemoryUsed: Long = 
onHeapStorageMemoryPool.memoryUsed
    +
    +  /**
    +   *  Off heap storage memory currently in use, in bytes.
    +   */
    +  final def offHeapStorageMemoryUsed: Long = 
offHeapStorageMemoryPool.memoryUsed
    +
    +  /**
    +   *  If the system isn't procfsBased the process tree metrics' values 
will be -1,
    +   *  meaning not available
    +   */
    +  final val pTreeInfo: ProcessTreeMetrics = new ProcfsBasedSystems
    +  if (pTreeInfo.isAvailable) {
    --- End diff --
    
    Why not create the process tree on instantiation of ProcfsBasedSystems 
class. You can maybe also make that a lazy val, so that it is instantiated only 
when needed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to