The bug could be due to ffmpeg 5.1 as opposed to ffmpeg 4.x  applied patches or some other change.
Valgrind (heaptrack is really great but I am too lazy to git it) on Oct 31, 2020 does not exhibit this astronomical loss of available memory.
October 31, 2020 GIT
==257884==    definitely lost: 256 bytes in 8 blocks
==257884==    indirectly lost: 64 bytes in 8 blocks
==257884==      possibly lost: 0 bytes in 0 blocks
Current GIT:
==4985==    definitely lost: 1,296 bytes in 9 blocks
==4985==    indirectly lost: 1,626,411 bytes in 272 blocks
==4985==      possibly lost: 528,288 bytes in 14 blocks


On Mon, Jan 23, 2023 at 3:01 PM Stefan de Konink <stefan@konink.de> wrote:
On Monday, January 23, 2023 10:56:00 PM CET, Andrew Randrianasulu wrote:
> sorry, I can't think about anything BUT disabling it by early return in
> functions allocating cache items ...

I added a -1, as effective.

Lets say the solution is the file should be closed, but I am not yet at the
point what either "does not do that" (mwindow/vwindow) or "is logically
wrong" (garbage collector).

--
Stefan