Possible Memory Leak in Vector Renderer
Firstly, thanks for making libshumate, its been great to be able to integrate maps into my apps seemlessly.
After porting to the new Vector renderer I noticed that memory use in the application rarely goes back down. The easiest way to reproduce this is by zooming in on a dense zone (say a city center), letting it render, then zooming back out and going to another city. I found that after 3-4 cities the application was using > 1GB of RAM and in one case caused my Librem5 to lock up.
To make sure this wasn't just my bug, I also tried to repeat the same in gnome-maps. With the "Experimental Map" enabled I can reproduce the issue perfectly. However, with the old raster maps memory use peaks at ~500MB and grows/reduces as you pan/zoom around.
In case this is intentional (to reduce rendering times), it seems a little overzealus. My device only had ~1GB free when the map was opened, all of that is consumed and will continue being consumed until something fails to allocate memory and crashes. I'd expect any caching to be quite a bit more limited.
In case it's useful, this was original discovered in Electrolysis. Most of the libshumate code can be found at https://gitlab.com/undef1/electrolysis/-/blob/master/src/window/imp.rs?ref_type=heads#L81-204
Thanks.