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

QEMULauncher memory leak #4449

Closed
jaltman opened this issue Sep 26, 2022 · 12 comments · Fixed by #4846
Closed

QEMULauncher memory leak #4449

jaltman opened this issue Sep 26, 2022 · 12 comments · Fixed by #4846
Milestone

Comments

@jaltman
Copy link

jaltman commented Sep 26, 2022

Describe the issue

QEMULauncher appears to leak memory when launching a Debian Buster arm64 VM on M1 macOS. The test VM is configured to launch with 3GB of ram. After 5 minutes of operation QEMULauncher requires 826.0MB of ram. After several days QEMULauncher has allocated more than 20GB of ram which is significantly larger than the 8GB M1 host memory.

Configuration

  • UTM Version: 4.0.6 (65)
  • macOS Version: Big Sur 11.7
  • Mac Chip: M1
  • Memory: 8GB
  • VM: Debian Buster 4.19.0-21-arm64 kernel

Crash log

There is no crash log. Eventually the host will run exhaust all memory and kill QEMULauncher. Before then the VM and the UTM UI become unresponsive due to paging to disk.

Debug log
To get the Debug log: open UTM, and open the settings for the VM you wish to launch. Near the top of the QEMU page is Debug Log. Turn it on and save the VM. After you experience the issue, open the VM settings again and select Export Log... and attach it here.

I have been unsuccessful up to this point at exporting the debug log due to the UTM UI becoming unresponsive. I will attempt to capture a log sooner but wanted to be sure to file a report as 4.0.x is nearing release. Is there another way to trigger the export of the log when the UTM UI is unresponsive?

Upload VM
It is unclear that the problem is related to one specific VM.

@osy
Copy link
Contributor

osy commented Sep 26, 2022

Is this unique to 4.0.x? Can you reproduce on 3.2.4?

@jaltman
Copy link
Author

jaltman commented Sep 26, 2022

Is this unique to 4.0.x? Can you reproduce on 3.2.4?

I tried 4.0.x because there were multiple problems on M1 using 3.2.4. I do not know if there was a memory leak because the VMs were not functional long enough to notice.

@jaltman
Copy link
Author

jaltman commented Sep 26, 2022

qemu-debug.log

Here is a debug.log. The VM was running for a few hours and memory allocation for QEMULauncher grew to 1.4GB. The VM was quite idle during that time.

@AlexRamRam
Copy link

Anecdotally, this seems to be happening for me as well.

UTM version 4.0.9
Apple M1 Pro running Ventura 13.1
Virtual OS: Ubuntu 22.04.1 LTS Desktop

Throughout a few hours, QEMULauncher's memory continues to grow even though the memory footprint within the virtual OS is constant.

@osy osy added this to the v4.1 milestone Dec 19, 2022
@osy
Copy link
Contributor

osy commented Dec 19, 2022

@AlexRamRam are you using GPU acceleration or no?

@AlexRamRam
Copy link

@AlexRamRam are you using GPU acceleration or no?

How do I check this?

@osy
Copy link
Contributor

osy commented Dec 19, 2022

@AlexRamRam Easiest way is to post your config.plist inside the .utm. Otherwise, go into the VM settings, under Display what is the name of the display hardware?

@AlexRamRam
Copy link

@AlexRamRam Easiest way is to post your config.plist inside the .utm. Otherwise, go into the VM settings, under Display what is the name of the display hardware?

My Emulated Display Card is virtio-ramfb

@AlexRamRam
Copy link

@osy I appreciate the work you guys have done here. Let me know if there's anything I can do to help with this.

@jaltman
Copy link
Author

jaltman commented Dec 20, 2022

The memory leak does not occur when the UTM window is minimized. I hope that helps.

@legsak1mbo
Copy link

I too am experiencing a similar issue.

Configuration
UTM Version: 4.1.5 (74)
macOS Version: 13.0.1 (22A400)
Mac Chip: M1
Memory: 16GB
VM: Debian 5.10.0-19-arm64

I'm running a fairly simple Debian VM which is itself running Home Assistant. About once a week I find that QEMULauncher has used up all available memory and has to be Force Quit. This happened earlier and despite me rebooting the host and relaunching everything QEMULauncher is already using 4.6GB. In fact it's jumped from 4.5 whilst I've been writing this.

I've updated to UTM 4.1.5 but the issue remains.

@osy
Copy link
Contributor

osy commented Jan 20, 2023

@legsak1mbo can you monitor the memory usage from within the VM guest? Make sure it’s not growing consistently. Also please open a new issue as this one is closed.

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

Successfully merging a pull request may close this issue.

4 participants