-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17019][Core] Expose on-heap and off-heap memory usage in various places #14617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2794daa
5f1fb3c
572cba6
f02b5ff
854116b
95574d5
a747089
80ed55f
60383b9
b30e7d0
643552c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,11 @@ class ExecutorSummary private[spark]( | |
| val totalShuffleWrite: Long, | ||
| val isBlacklisted: Boolean, | ||
| val maxMemory: Long, | ||
| val executorLogs: Map[String, String]) | ||
| val executorLogs: Map[String, String], | ||
| val onHeapMemoryUsed: Option[Long], | ||
| val offHeapMemoryUsed: Option[Long], | ||
| val maxOnHeapMemory: Option[Long], | ||
| val maxOffHeapMemory: Option[Long]) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These fields now change to Option, it will not be printed out for old event log. |
||
|
|
||
| class JobData private[spark]( | ||
| val jobId: Int, | ||
|
|
@@ -111,7 +115,11 @@ class RDDDataDistribution private[spark]( | |
| val address: String, | ||
| val memoryUsed: Long, | ||
| val memoryRemaining: Long, | ||
| val diskUsed: Long) | ||
| val diskUsed: Long, | ||
| val onHeapMemoryUsed: Option[Long], | ||
| val offHeapMemoryUsed: Option[Long], | ||
| val onHeapMemoryRemaining: Option[Long], | ||
| val offHeapMemoryRemaining: Option[Long]) | ||
|
|
||
| class RDDPartitionInfo private[spark]( | ||
| val blockName: String, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,8 +71,8 @@ class BlockManagerMasterEndpoint( | |
| logInfo("BlockManagerMasterEndpoint up") | ||
|
|
||
| override def receiveAndReply(context: RpcCallContext): PartialFunction[Any, Unit] = { | ||
| case RegisterBlockManager(blockManagerId, maxMemSize, slaveEndpoint) => | ||
| context.reply(register(blockManagerId, maxMemSize, slaveEndpoint)) | ||
| case RegisterBlockManager(blockManagerId, maxOnHeapMemSize, maxOffHeapMemSize, slaveEndpoint) => | ||
| context.reply(register(blockManagerId, maxOnHeapMemSize, maxOffHeapMemSize, slaveEndpoint)) | ||
|
|
||
| case _updateBlockInfo @ | ||
| UpdateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size) => | ||
|
|
@@ -276,7 +276,8 @@ class BlockManagerMasterEndpoint( | |
|
|
||
| private def storageStatus: Array[StorageStatus] = { | ||
| blockManagerInfo.map { case (blockManagerId, info) => | ||
| new StorageStatus(blockManagerId, info.maxMem, info.blocks.asScala) | ||
| new StorageStatus(blockManagerId, info.maxMem, Some(info.maxOnHeapMem), | ||
| Some(info.maxOffHeapMem), info.blocks.asScala) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add one more field |
||
| }.toArray | ||
| } | ||
|
|
||
|
|
@@ -338,7 +339,8 @@ class BlockManagerMasterEndpoint( | |
| */ | ||
| private def register( | ||
| idWithoutTopologyInfo: BlockManagerId, | ||
| maxMemSize: Long, | ||
| maxOnHeapMemSize: Long, | ||
| maxOffHeapMemSize: Long, | ||
| slaveEndpoint: RpcEndpointRef): BlockManagerId = { | ||
| // the dummy id is not expected to contain the topology information. | ||
| // we get that info here and respond back with a more fleshed out block manager id | ||
|
|
@@ -359,14 +361,15 @@ class BlockManagerMasterEndpoint( | |
| case None => | ||
| } | ||
| logInfo("Registering block manager %s with %s RAM, %s".format( | ||
| id.hostPort, Utils.bytesToString(maxMemSize), id)) | ||
| id.hostPort, Utils.bytesToString(maxOnHeapMemSize + maxOffHeapMemSize), id)) | ||
|
|
||
| blockManagerIdByExecutor(id.executorId) = id | ||
|
|
||
| blockManagerInfo(id) = new BlockManagerInfo( | ||
| id, System.currentTimeMillis(), maxMemSize, slaveEndpoint) | ||
| id, System.currentTimeMillis(), maxOnHeapMemSize, maxOffHeapMemSize, slaveEndpoint) | ||
| } | ||
| listenerBus.post(SparkListenerBlockManagerAdded(time, id, maxMemSize)) | ||
| listenerBus.post(SparkListenerBlockManagerAdded(time, id, maxOnHeapMemSize + maxOffHeapMemSize, | ||
| Some(maxOnHeapMemSize), Some(maxOffHeapMemSize))) | ||
| id | ||
| } | ||
|
|
||
|
|
@@ -464,10 +467,13 @@ object BlockStatus { | |
| private[spark] class BlockManagerInfo( | ||
| val blockManagerId: BlockManagerId, | ||
| timeMs: Long, | ||
| val maxMem: Long, | ||
| val maxOnHeapMem: Long, | ||
| val maxOffHeapMem: Long, | ||
| val slaveEndpoint: RpcEndpointRef) | ||
| extends Logging { | ||
|
|
||
| val maxMem = maxOnHeapMem + maxOffHeapMem | ||
|
|
||
| private var _lastSeenMs: Long = timeMs | ||
| private var _remainingMem: Long = maxMem | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that, with this, we get JSON serialization of SparkListenerBlockManagerAdded events for free? It's important that an external history server be able to see the new maxOnHeapMem and maxOffHeapMem values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so.