Open thunderstorm010 opened 4 hours ago
Hi! Thanks for opening your first issue here! :smile:
Hi, could you please make a minimal reproducible sample? For example, maybe
pub fn f(sink: StreamSink<Vec<u8>>) {
loop {
sink.add(vec![0; 1000000]);
sleep(100ms);
}
}
And to debug, also try to do manually trigger a (full) GC on Dart side, and see whether memory is better.
And try dart's devtool's memory part, to see what is eating a lot of memory, and why they are alive instead of GCed.
Btw, if you want to show videos, then I guess it is great to avoid such rust-to-dart transfer, because after you transfer the bytes to Dart, indeed dart has to again transfer to its engine and display, which is quite long and slow.
One possible way may be, use https://github.com/irondash/irondash/tree/main/texture. Then the rust gstreamer frames can directly be displayed to screen, and the rest of the app can be written in Flutter.
Possibly related: https://github.com/fzyzcjy/flutter_rust_bridge/issues/1776
Hi. I'm trying to stream video frames (in this example Vec) from Rust to Flutter. But frb seems to eat more and more RAM growing exponentially.
Here is my code:
Notes: 1) Removing the line with
stream_sink.add
results in constant memory use (aka no problem.) (I think this means the problem is not with Gstreamer) 2) Even when I remove the dart side code handling the stream (inside the Stream.listen function), memory use continues to grow. 3) If further information is needed, just write a comment and I will answer asap.Thanks for everything