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

idle Multipass memleak ? #3454

Open
cryptosven76 opened this issue Apr 1, 2024 · 12 comments
Open

idle Multipass memleak ? #3454

cryptosven76 opened this issue Apr 1, 2024 · 12 comments
Assignees
Labels
bug medium medium importance

Comments

@cryptosven76
Copy link

Describe the bug
Describe what your problem is.
i noticed that since earlier this year multipassd consumes GB's of memory over time even its not used at all

To Reproduce
How, and what happened?

  1. simply start multipass when your OS reboots

Expected behavior
What did you expect to happen?
Not growing in consumption if not used.

Logs
Please provide logs from the daemon, see accessing logs on where to find them on your platform.

Additional info

  • OS: macOS 14.4.1
  • ~ % multipass version
    multipass 1.13.1+mac
    multipassd 1.13.1+mac

multipass info --all
Warning: the --all flag for the info command is deprecated. Please use info with no positional arguments for the same effect.
Name: rex101
State: Stopped
Snapshots: 0
IPv4: --
Release: --
Image hash: f885a8e8f62a (Ubuntu 22.04 LTS)
CPU(s): --
Load: --
Disk usage: --
Memory usage: --
Mounts: --

  • multipass get local.driver
    multipass get local.driver
    qemu

Additional context
multipassd.log

Add any other context about the problem here.

@cryptosven76 cryptosven76 added bug needs triage Issue needs to be triaged labels Apr 1, 2024
@cryptosven76
Copy link
Author

PID COMMAND %CPU TIME #TH #WQ #PORT MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEINS IDLEW POWE INSTRS CYCLES JETP USER #MRE RPRV VPRV VSIZ KPRV KSHR
789 multipassd 0.4 27:31.49 22 1 81 24G+ 0B 23G 789 1 sleeping *0[1] 0.00000 0.00000 0 3328701+ 253 5156 1787 19511677+ 60661 4758750+ 795 21577 0.4 7419645 5633897 40 root N/A N/A N/A N/A N/A N/A

@cryptosven76
Copy link
Author

you can see it consumed 24G at this time, since the boot of this OS i never started any VM, its in idle state for a week. i see the same behavior on 2 completely independent systems

@ricab
Copy link
Collaborator

ricab commented Apr 2, 2024

Hi @cryptosven76,

Thank you for reporting, it looks like we have a memory leak.

@ricab
Copy link
Collaborator

ricab commented Apr 2, 2024

@cryptosven76, for the time being, you can try to restart the daemon from time to time. Something like this should do, when your instances are stopped:

sudo launchctl kickstart /Library/LaunchDaemons/com.canonical.multipassd.plist

@ricab
Copy link
Collaborator

ricab commented Apr 2, 2024

As a data point, this does not appear to manifest in a snap over a period of ~2h.

@townsend2010 townsend2010 removed the needs triage Issue needs to be triaged label Apr 5, 2024
@cryptosven76
Copy link
Author

i restarted it yesterday and today i have again 3 GB without using it at all.
i wonder if this gets triggered by suspend or sleeps states as the growth seems to be much larger on my macbook than on my mac pro workstation.

@ricab
Copy link
Collaborator

ricab commented Apr 8, 2024

Hi @cryptosven76, how are you measuring memory? If you are referring to Virtual Memory, it is normal for multipassd to use 3GB right after being launched. But that is very different from actual RAM being used. Virtual Memory includes a lot of stuff that is not actually loaded, like all the libraries, many of which will be shared by other processes.

I also see multipassd using 3GB of Virtual Memory right after being launched, but the actual Resident Set Size (memory in RAM) is 88MB, and some of that is shared. For comparison, I see a browser with a dozen tabs using 21GB of Virtual Memory, with RSS being 600 MB.

Of course, if the 3GB you see are RSS, that is a problem, especially if you observe it growing over time.

How many VMs do you have when you see this? Do you usually have them running?

@kacperk
Copy link

kacperk commented May 3, 2024

I have similar issue on my Mac. It can grow to sizes that it kills OS (> 24GB) and it happens when there is no VMs running.

@ricab ricab self-assigned this May 3, 2024
@ricab
Copy link
Collaborator

ricab commented May 3, 2024

Hi @kacperk, sorry you are experiencing this. A few questions to help us understand the issue to better reproduce/debug:

  • How long had your multipassd been running?
  • Had you been suspending/resuming often?
  • Do you observe it growing after closing and opening the laptop lid?
  • Do you see it growing at a steady rate?
  • Do you see it changing over a period of a few hours?
  • And how/where are you measuring the memory size?

@ricab ricab added the question label May 3, 2024
@kacperk
Copy link

kacperk commented May 6, 2024

Observation from today:

  1. From Friday morning (around 72h)
  2. Around 10-20 times + whatever macOS decide to wake up when connencted on charger
  3. Don't know
  4. Yes, around 10MB every 2minutes
  5. Yes
  6. Whatever ActivityMonitor shows

@kacperk
Copy link

kacperk commented May 6, 2024

Screen recording - https://letsbuild.d.pr/i/ueIpt0/2VUO5IPqzF This time machine wasn't suspended, no VMs running - just idle.

@ricab
Copy link
Collaborator

ricab commented May 7, 2024

Great, thank you @kacperk. That should give us enough to track it down.

@ricab ricab added medium medium importance and removed question labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug medium medium importance
Projects
None yet
Development

No branches or pull requests

4 participants