queimadus commented on code in PR #1622:
URL: https://github.com/apache/pekko/pull/1622#discussion_r1894900387
##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlatMapPrefix.scala:
##########
@@ -128,8 +129,8 @@ import pekko.util.OptionVal
def materializeFlow(): Unit =
try {
- val prefix = accumulated.toVector
- accumulated.clear()
+ val prefix = builder.result()
+ builder = null // free for GC
Review Comment:
This change does seem to help when running the provided example. This crash
by lack of memory. Previous run would crash out at around the 2 minute mark.
<img width="1295" alt="Screenshot 2024-12-22 at 11 34 34"
src="https://github.com/user-attachments/assets/f7b7b846-b70a-45c7-8468-8fc0cc6352b5"
/>
--
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]