Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,12 @@ public void showMemoryUsage() {
MDC.of(LogKeys.MEMORY_SIZE, memoryNotAccountedFor),
MDC.of(LogKeys.TASK_ATTEMPT_ID, taskAttemptId));
logger.info(
"{} bytes of memory are used for execution and {} bytes of memory are used for storage",
"{} bytes of memory are used for execution " +
"and {} bytes of memory are used for storage " +
"and {} bytes of memory are used but unmanaged",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but this might sounds misleading. Can we revise this like the following, @zhztheplayer ?

- and {} bytes of memory are used but unmanaged
+ and {} bytes of unmanaged memory are used

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi dongjoon-hyun, just to clarify, I guess you were suggesting to only change the 3rd sentence here?

MDC.of(LogKeys.EXECUTION_MEMORY_SIZE, memoryManager.executionMemoryUsed()),
MDC.of(LogKeys.STORAGE_MEMORY_SIZE, memoryManager.storageMemoryUsed()));
MDC.of(LogKeys.STORAGE_MEMORY_SIZE, memoryManager.storageMemoryUsed()),
MDC.of(LogKeys.MEMORY_SIZE, UnifiedMemoryManager$.MODULE$.getUnmanagedMemoryUsed()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ object UnifiedMemoryManager extends Logging {
// Atomic flag to ensure polling is only started once per JVM
private val pollingStarted = new AtomicBoolean(false)

/**
* Returns the total unmanaged memory in bytes, including both
* on-heap unmanaged memory and off-heap unmanaged memory.
*/
private[spark] def getUnmanagedMemoryUsed: Long = {
UnifiedMemoryManager.unmanagedOnHeapUsed.get() + UnifiedMemoryManager.unmanagedOffHeapUsed.get()
}

/**
* Register an unmanaged memory consumer to track its memory usage.
*
Expand Down