<HTML><BODY><div>Hi.</div><div> </div><div>Consider following pipeline:</div><div><div><div>rtspsrc ! rtph264depay ! h264parse ! tee name=vi vi. ! queue ! splitmuxsink vi. ! queue ! avdec_h264 ! jpegenc ! apsink</div><div> </div><div>Appsink config and NewSample handler is below. My problem is that it consumes lot’s of (unmanaged) memory.</div><div>There is no leak, it works ok, after .net GC run memory lower to normal values and then grows again. It looks like</div><div>saw-tooth. I’ve tried to limit max-buffers (set it to 100 or 1), drop = true but it seems that nothing works. Memory profiler shows smth like 30K instances of Gst.Memory holds 1.5Gb of unmanaged (in terms of .net) memory. Aftre GC collect, it seems to collect some of these instances and release some unmanaged memory (say it lowers 10 times). Again, there is no leeks, I just want to lower memory consumption of appsink element. </div><div> </div><div>Any ideas how to achieve that?</div><div><div><div> </div><div>Thanks in advance.</div><div> </div><div> </div><div>Appsink code:</div><div> </div><div> var appSink = new AppSink("appsink_{CaptureConfig.CameraId}");</div><div> appSink.NewSample += AppSinkNewSample;</div><div> appSink.EmitSignals = true;</div></div></div></div></div><div><div><div> </div><div>private void AppSinkNewSample(object o, NewSampleArgs args)</div><div> {</div><div> if (o is AppSink aps)</div><div> {</div><div> using (var sample = aps.PullSample())</div><div> {</div><div> using (var buf = sample.Buffer)</div><div> {</div><div> SomeStuff(buf);</div><div> }</div><div> }</div><div> }</div><div> }</div></div></div><div> </div><div> </div><div> </div></BODY></HTML>