Istvan Soos
unread,Oct 11, 2017, 6:19:35 AM10/11/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to General Dart Discussion
I've encountered this over the past few months several times, and I
have no clue how to debug or resolve it:
Case 1: Reading a large file (> 10GB) line-by-line.
Case 2: Running a 'SELECT * FROM table;' in Postgres (>1M rows).
In both cases, the individual lines or rows are not too large, usually
a few hundreds of kilobytes max, and the related processing is not
that big deal either, mostly some kind of aggregation which may have
an async component in it.
However, when that async processing takes a bit more time, the IO
operations can fill up the buffers, and the memory consumption becomes
much more than it should be (e.g. in the 10 GBs instead of a few
hundred MB).
What is the proper way (or best practice) to apply back-pressure, so
that the source does not floods the memory?
What can we do, if the source is a third-party library that doesn't do
the ideal thing (e.g. may not propagate pause)?
Thanks,
Istvan