Open kkoreilly opened 10 months ago
This is happening on desktop too! we have a leak.
running taskmanager and resizing it causes significant memory increase to itself.
but continuously running taskmanager is very stable; as is running a large complex nnet model (boa) with lots of 3d and 2d updating happening at high frequency. it is definitely not leaking in any of the basic updating / rendering mechanisms.
my first report above was due to gide having to be killed due to excessive memory usage -- 390 GB or something crazy like that. so somewhere it seems to have something like an exponential leak.
False alarm on gide: it appears to be due to an issue with go mod mode in packages with lots of go mod problems -- it is not something happening specifically within gi code. There might still be some kind of issue with taskmanager resizing while constantly updating but that may just be a lot of memory churn and not a leak. Just resizing gide continuously doesn't seem to be a problem (minor temporary memory increases).
note: gide leak fixed.
I can confirm that this still happens: the demo starts at 142 MB of memory usage on web, and then climbs to at least 506 MB. It seems to only climb when the tab is not open.
This definitely only happens when the tab / window is not open / focused.
I appear to have fixed the most severe memory leak issue in 3dcf77a, which resulted in apps crashing on mobile web due to excessive memory usage. It seems like there may still be a lower severity high memory usage issue on all platforms regarding both fonts and scrolling, and there are also still performance issues with gradient and text rendering, especially while scrolling. The font issues should be resolved when we start using go-text, and we need to look into the scrolling issues more.
Just to be clear, the scrolling issue is that memory usage reliably and significantly increases when you scroll, and this increase persists as you continue to scroll. A good example of this is scrolling in the icons page in the demo. The performance issue is that the app noticeably lags when you render gradients and large blocks of text. This bad performance is particularly notable when scrolling.
Actually, the excessive memory usage crash still seems to be happening on desktop occasionally.
The crash on Android web is still happening, and I determined after hours of debugging that this issue is actually not a memory leak, but a bizarre wasm compilation / Chromium issue associated with goldmark (https://github.com/golang/go/issues/68156).
As of a2313f0, we are now (at least temporarily) using a different markdown library, which prevents this issue from happening.
EDIT: this issue is actually not a memory leak, but a wasm compilation / Chromium issue as described below.
Memory usage on web has increased by a factor of more than 5x since the version the Goki website is currently using. This might be caused by filesystem or resizing logic.