maestro
maestro copied to clipboard
High memory usage with Maestro Studio on Linux
Describe the bug Memory use on Linux increases dramatically when using Maestro Studio - it will slowly and steadily increase from a baseline of about 44% (of 32G) until the computer crashes. Closing Maestro Studio immediately reduces memory usage back to ~44%. (The tests finishing does not affect memory usage.)
It appears that this happens when Maestro Studio is running while a Maestro test on the device it is observing is running, even if Maestro Studio itself is not being interacted with.
To Reproduce
(On Linux)
Launch an emulator with an app built.
Launch Maestro Studio - maestro studio
.
Run a few long Maestro tests. Watch your memory use increase.
Expected behavior Memory use to increase slightly, due to Maestro Studio running, but then remain steady.
Screenshots Not really applicable.
Environment information (please complete the following information):
- Maestro version [e.g. v1.2.3] - 1.27.0
- Platform: [e.g. iOS 16.4.1, Android 11.0, Chrome] - Android
- Framework: [Native iOS/Android, Flutter, React Native, etc] - React Native
- Device model and OS version: [e.g. iPhone6] - any android (usually Pixel 6 or Nexus S)
- Simulator, emulator or physical device - Android Studio Emulator
- Host [e.g. Mac M1, Windows, Linux, etc] - Linux (Ubuntu)
Workspace (if applicable) I can't share the application code, nor is the issue really about a Maestro test, but if there's specific information you need let me know and I'll do my best.
Bugreport output (if applicable)
The zip files created when maestro bugreport
can be uploaded here as well if applicable.
Additional context Add any other context about the problem here.
A further note on this - on Linux, killing Maestro Studio in one terminal with ctrl + c
also kills any simultaneously-running Maestro test.
I thought this was universal behavior, but I just now realized this isn't the case on iOS - and so wondered if it might be connected to the memory leak bug. (Which is still very much happening - Maestro Studio is only usabel for about ~7min on Linux.)
I have the same issue with the latest version of Maestro.
I run maestro tests from a raspberry, so this high memory usage is a massive issue. It completely freezes a (32gb sd card) raspberry pi in around 20 hours.
Restarting RPi works, but just for around 24 hours.
After investigating, I found that ./tmp folder is getting jammed up by hundreds of maestro-app*.apk & maestro-server*.apk files. Deleting those will clear up the memory.
As a temporary fix, I will just involve a cleanup of those files into a test as a solution.
Hey @scriptas – do you mean that you use Maestro Studio, or just run tests with maestro test
on your Raspberry Pi? Also, thanks for sharing the findings with us.
@bartekpacia I use raspberry to run the tests. I do not use the maestro studio.
And that fix I've suggested to remove temp files has now been working very well for me for the last 6 months. Raspberry is no longer freezing, and seems like no important data related to the test logs is actually being deleted.