Manoel Aranda Neto
Manoel Aranda Neto
> I have the same error message but when I have a TextFormField on the page and SessionReplay activated. > > Once the focus in on the TextFormField I get...
@waskalien, which tools are you using to check for memory increase? standard [memory view](https://docs.flutter.dev/tools/devtools/memory)? Can you provide an MRE repo where I can just run the project? It should include...
@waskalien https://github.com/waskalien/posthog-session-replay-memory-leak/blob/68b7b0a7d3abb39634cd3c3d378a066a01491f54/lib/main.dart#L39-L41 is this something realistic? Session replay will only take a screenshot (or consume memory) if there are screen changes; apparently, you are forcing that. If you remove that,...
> To illustrate: even if we do nothing and just display a static SVG with no movement, the app’s memory usage keeps increasing indefinitely. Wouldn’t you consider that a memory...
So using the [memory view](https://docs.flutter.dev/tools/devtools/memory) on Dart/Flutter, the memory is pretty stable.
Improvements such as https://github.com/PostHog/posthog-flutter/issues/165 could help here, improving performance overall and not only the leak, I mean.
I found something here https://github.com/PostHog/posthog-flutter/pull/166 but it didnt improve much so its not the cause
So I finally narrowed down the issue to [this line](https://github.com/PostHog/posthog-flutter/blob/91d8ea9dceeca8e572015c601a2a6fc0411d291e/lib/src/replay/screenshot/screenshot_capturer.dart#L97). The problem isn't really memory leaking but a similar side effect. We need an image so we have to call...
@waskalien thanks for that. I understand your point but I just don't have control over the GC, I cannot release the image after using it, we call `dispose` right away...
nope, `debugGetOpenHandleStackTraces` is new to me, will check today