He-Pin commented on code in PR #1623:
URL: https://github.com/apache/pekko/pull/1623#discussion_r1894921062


##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:
##########
@@ -237,7 +239,9 @@ import pekko.util.ccompat.JavaConverters._
     override def onUpstreamFinish(): Unit = {
       if (!prefixComplete) {
         // This handles the unpulled out case as well
-        emit(out, (builder.result(), Source.empty), () => completeStage())
+        val prefix = builder.result();
+        builder = null // free for GC
+        emit(out, (prefix, Source.empty), () => completeStage())

Review Comment:
   This problem is a kind of AsyncCallback leak, 
https://github.com/apache/pekko/pull/408
   where many instances consume memories.
   
   To total fix this, we will lost some support for debug I think, eg the 
`org.apache.pekko.stream.impl.fusing.GraphInterpreter#toSnapshot` 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to