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

g2p-studio leaks memory when used repeatedly #195

Open
joanise opened this issue Oct 12, 2022 · 3 comments
Open

g2p-studio leaks memory when used repeatedly #195

joanise opened this issue Oct 12, 2022 · 3 comments

Comments

@joanise
Copy link
Collaborator

joanise commented Oct 12, 2022

To reproduce, set block_size = 400 in g2p/tests/test_studio.py and observe the chromium process grow in memory and (usually) crash after a while as we try to process all the test cases. Set headless=False to observe the browser while this is happening.

After 100 cases, the process uses about 1GB of RAM and often dies soon after, so something is happening in the app in the browser that makes it unstable after it's been used to process many different queries in many different language pairs. The crash does not always happen at the same time, though.

Tested on Windows the python run_studio.py at the g2p root in one windows and ./test_studio.py in another. Also tested in CI with the test-studio job in studio-release-tests.yml which uses gunicorn to serve the app. The server does not seems affected, though, the problem is clearly the browser.

@joanise
Copy link
Collaborator Author

joanise commented Oct 13, 2022

I had one instance of the test suite succeed with a block size of 400 with the latest tweaked version of the test suite, and it was taking 3.6GB by the time all 399 test cases were done. Watching the process go, the browser memory requirements do seem to be very close to linear in the number of test cases run.

joanise added a commit that referenced this issue Oct 13, 2022
 - split the ~400 test cases into blocks of 50 because the app currently
   leaks memory so the browser bloats and eventually crashes. (See
   issues #195)
 - do several attempts for each individual test case, with a delay
   between attempts - sometimes that's all we need to succeed.
 - log more information on screen so we can see what's going on and
   where failures are right on screen or in the CI logs
@roedoejet
Copy link
Owner

Looks like there are general memory leak problems with web sockets :( websockets/ws#804

I would guess that the problem is there or in HandsOnTable - the rest of the app is too basic to really have much of a memory leak problem I would guess

@joanise
Copy link
Collaborator Author

joanise commented Oct 13, 2022

In that link, there is talk that disabling permessage-deflate helps. Could that apply to us?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants