jiangxin369 commented on code in PR #248: URL: https://github.com/apache/flink-ml/pull/248#discussion_r1281676904
########## flink-ml-iteration/flink-ml-iteration-common/src/main/java/org/apache/flink/iteration/datacache/nonkeyed/ListStateWithCache.java: ########## @@ -82,11 +82,13 @@ public ListStateWithCache( runtimeContext.getUserCodeClassLoader()); if (fraction > 0) { MemoryManager memoryManager = containingTask.getEnvironment().getMemoryManager(); + // TODO Adds a configuration to set the fraction of the memory that the + // ListStateWithCache can use. segmentPool = new LazyMemorySegmentPool( containingTask, memoryManager, - memoryManager.computeNumberOfPages(fraction)); + memoryManager.computeNumberOfPages(fraction) / 2); Review Comment: That's a good point. I also think that the `iteration.memory.feedback-buffer.fraction` we just added is inappropriate because it is not defined in `ManagedMemoryUseCase` of Flink. So it would grab the managed memory with `ListStateWithCache` which may cause memory allocation failed. I changed the implementation to also use the `ManagedMemoryUseCase.OPERATOR` to share the managed memory with `ListStateWithCache`. Would you have another look? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org