RexXiong commented on code in PR #3018:
URL: https://github.com/apache/celeborn/pull/3018#discussion_r1920949498
##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/memory/MemoryManager.java:
##########
@@ -557,6 +580,47 @@ public static void reset() {
_INSTANCE = null;
}
+ private void resumeByPinnedMemory(ServingState servingState) {
+ switch (servingState) {
+ case PUSH_AND_REPLICATE_PAUSED:
+ logger.info(
+ "Serving State is PUSH_AND_REPLICATE_PAUSED, but resume by lower
pinned memory {}",
+ getNettyPinnedDirectMemory());
+ resumeReplicate();
+ resumePush();
+ case PUSH_PAUSED:
+ logger.info(
+ "Serving State is PUSH_PAUSED, but resume by lower pinned memory
{}",
+ getNettyPinnedDirectMemory());
+ resumePush();
+ }
+ }
+
+ private boolean canResumeByPinnedMemory() {
+ if (pinnedMemoryCheckEnabled
+ && System.currentTimeMillis() >= pinnedMemoryNextCheckTime
+ && getAllocatedMemory() / (double) (maxDirectMemory) <
pinnedMemoryResumeRatio) {
+ pinnedMemoryNextCheckTime += pinnedMemoryCheckInterval;
Review Comment:
`pinnedMemoryNextCheckTime` compute seems incorrect, We can Use
`System.currentTimeMillis()` as last checkTime, then we can use
`System.currentTimeMillis()-lastCheckTime >= pinnedMemoryCheckInterval` to
check whether need resume.
--
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]