Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing in wasm in Chrome on Android when importing goldmark #780

Open
kkoreilly opened this issue Jan 10, 2024 · 12 comments
Open

Crashing in wasm in Chrome on Android when importing goldmark #780

kkoreilly opened this issue Jan 10, 2024 · 12 comments
Assignees
Labels
bug Something isn't working correctly
Milestone

Comments

@kkoreilly
Copy link
Member

kkoreilly commented Jan 10, 2024

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.

@kkoreilly kkoreilly added the bug Something isn't working correctly label Jan 10, 2024
@kkoreilly kkoreilly added this to the v2 milestone Jan 10, 2024
@kkoreilly kkoreilly self-assigned this Jan 10, 2024
@rcoreilly
Copy link
Member

This is happening on desktop too! we have a leak.

@rcoreilly
Copy link
Member

running taskmanager and resizing it causes significant memory increase to itself.

@rcoreilly
Copy link
Member

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.

@kkoreilly kkoreilly changed the title High memory usage on web Memory leak Jan 10, 2024
@rcoreilly
Copy link
Member

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).

@rcoreilly
Copy link
Member

note: gide leak fixed.

@kkoreilly kkoreilly changed the title Memory leak Memory leak on web Feb 23, 2024
@kkoreilly
Copy link
Member Author

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.

@kkoreilly
Copy link
Member Author

This definitely only happens when the tab / window is not open / focused.

@kkoreilly
Copy link
Member Author

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.

@kkoreilly
Copy link
Member Author

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.

@kkoreilly
Copy link
Member Author

Actually, the excessive memory usage crash still seems to be happening on desktop occasionally.

kkoreilly added a commit that referenced this issue Jun 24, 2024
@kkoreilly kkoreilly changed the title Memory leak on web Crashing in wasm in Chrome on Android when importing goldmark Jun 24, 2024
@kkoreilly
Copy link
Member Author

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 (golang/go#68156).

kkoreilly added a commit that referenced this issue Jul 15, 2024
kkoreilly added a commit that referenced this issue Jul 15, 2024
…emporary workaround for #780; fixes basic example with goldmark but not docs"

This reverts commit 5c40682.
@kkoreilly
Copy link
Member Author

As of a2313f0, we are now (at least temporarily) using a different markdown library, which prevents this issue from happening.

@kkoreilly kkoreilly modified the milestones: v0.3, v0.4 Jul 23, 2024
@kkoreilly kkoreilly added this to Bugs Nov 18, 2024
@github-project-automation github-project-automation bot moved this to Todo in Bugs Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
Status: Todo
Development

No branches or pull requests

2 participants