I'm investigating unexpected memory growth and heap profiling points
to gioui.org@v0.6.0/io/input/router.go:307 holding onto scratchFilters
in Router.key.processedFilter. In my case, this appears to be caused
by checking *widget.Clickable.Clicked() on each FrameEvent.
A minimal-ish reproducer:
https://gist.github.com/j2webs/1b95a6204a6c30c8555b095e1768de30
And a heap profile for convenience:
https://drive.google.com/file/d/1RdZUh1fGU8dyoqk6TIfq3_FwvUx29Z8m
Running the reproducer with a larger number of buttons, e.g. 15, will
accelerate the effect such that it shows up relatively quickly when
profiling.
A cursory dig in the surrounding code didn't turn up anything
managing/capping (or using?) Router.key.processedFilter, but I could
be missing something. Are we simply missing something in our use of
*widget.Clickable?
Thanks,
Joe Webster
Hi Elias,
Thank you! I was preparing to inquire about the appropriate course of
action (removal or, perhaps, mirroring handler.processedFilter's use
in Router.execute()) -- I guess you've answered the question!
Best,
Joe
On Fri, Jun 7, 2024 at 4:34 AM Elias Naur <mail@eliasnaur.com> wrote:
>> Hi Joe,>> Thanks for noticing and reporting this issue, which should be fixed by>> gioui.org/commit/56177c55cfbb4e07008f7646f0eb8d9912e95423>> Elias