systemstats memory leak since Monterey 12.3

Since update to Monterey 12.3 (also 12.3.1) the process "systemstats" from time to time starts to consume more and more memory until I kill it forcefully with


sudo killall systemstats


Memory consumption exceeded the available memory of my Mac (16GB) already several times, leading to bad response times of the whole machine and huge amounts of swap usage. After killing the process, swap usage immediately decreases.


Any idea?


Thanks a lot


Wolfgang

MacBook Pro 15″, macOS 12.3

Posted on May 5, 2022 1:31 AM

Reply
Question marked as Top-ranking reply

Posted on May 5, 2022 2:34 AM

Has the Curser in Size been altered from Normal in Accessibility ?


There are still reports appear that this can cause a Memory Leakage



1 - Suggest restarting in Safe Mode. This will perform a Disk Repair, clear cache files and only load Apple Software, extensions and fonts. The boot up will be slow and can take some time - Normal.


2 - Sometimes a Safe Boot followed by a Normal Boot will just put things right.


3 - Does the issue present in this mode ?


4 - If not - there could be something in the main User Account playing up. To further isolate this - Set up users, guests, and groups on Mac. Then log out of the Main User account and log into the dummy account and test again if the issue persists.


5 - If the issue is present in the dummy account - then, this appears to be a System Wide issue on the computer.


6 - If after performing each of the above steps is the order that have been presents  and still have issues - please advise for possible further assistance


refer to below running M1 Mac Mini Monterey 12.3.1


19 replies
Question marked as Top-ranking reply

May 5, 2022 2:34 AM in response to wolfii2

Has the Curser in Size been altered from Normal in Accessibility ?


There are still reports appear that this can cause a Memory Leakage



1 - Suggest restarting in Safe Mode. This will perform a Disk Repair, clear cache files and only load Apple Software, extensions and fonts. The boot up will be slow and can take some time - Normal.


2 - Sometimes a Safe Boot followed by a Normal Boot will just put things right.


3 - Does the issue present in this mode ?


4 - If not - there could be something in the main User Account playing up. To further isolate this - Set up users, guests, and groups on Mac. Then log out of the Main User account and log into the dummy account and test again if the issue persists.


5 - If the issue is present in the dummy account - then, this appears to be a System Wide issue on the computer.


6 - If after performing each of the above steps is the order that have been presents  and still have issues - please advise for possible further assistance


refer to below running M1 Mac Mini Monterey 12.3.1


Jun 6, 2022 10:25 PM in response to dialabrain

I installed etrecheck and checked the results. Removed some obsolete kernel extensions first and rebooted. Now waiting how systemstats behaves.


The extensions I removed were:

  • A DriveGenius Kernel extension
  • The SnapCam kernel extension (the app was already removed but the extension obviously not)
  • Two RTL815 driver extensions from 2014
  • A HP Fax driver kernel extension from 2013

I'm quite sure they have been taken over from my previous Mac by the migration assistant.


Jul 14, 2022 3:10 AM in response to wolfii2

I have (or hopefully had) this issue as well on my iMac 24".

My User account was migrated from my MacBook Pro 2016. At time of migration both were running macOS 11. macOS 12 Upgrade was installed to the iMac later - just in case this may make a difference.

I see tons of messages in system.log (mentioning, that ASL is taking over the message)


What I recently did - after these Safe Boot options, which only helped for a short period:

  • Removed Docker App and a lot of its components,
  • cleaned up some other outdated files and extensions,
  • cleaned up the database files created by systemstats (in /private/var/db/systemstats/, check output in Terminal using "systemstats --list-files" or "ls -l /private/var/db/systemstats/*")
  • rebooted my iMac.


Since then (yesterday - using sleep mode overnight) CPU and Memory usage seems to be fine - I hope it continues this way.

Of course I do not know, what solved the problem. A few days earlier I forced re-indexing my internal volume, which did not affect the issue. Potentially some systemstats DB files were migrated from the older Mac and systemstats had a really hard time to deal with them. Right now "systemstats --list-files" does not give any output, "ls /private/var/db/systemstats/*" gives several files,


Maybe this is helping some of you - and maybe helps Apple to fix the issue. Improved log rotation or discarding older files might be an improvement. Also sharing of Usage data with Apple is disabled on my machine. Maybe systemstats is therefore piling up more data than it can handle, because it would only remove the data locally after sharing it with Apple.

Jun 6, 2022 2:09 AM in response to wolfii2

Since the Safe Mode done much earlier has not helped >>


There could be something in the main User Account playing up. To further isolate this - Set up users, guests, and groups on Mac. Then log out of the Main User account and log into the dummy account and test again if the issue persists.


If the issue is present in the dummy account - then, this appears to be a System Wide issue on the computer.


If after performing each of the above steps is the order that have been presents  and still have issues - please advise for possible further assistance.

Jun 6, 2022 2:43 AM in response to wolfii2

wolfii2 wrote:

Cursor settings are Default.
Update to 12.4 didn't help to solve the situation.

FWIW, I have 4 Macs running Monterey. 3 of which are on 24/7. I checked all three. The systemstats process never exceeds 5MB on any of them. Something you have installed is causing a problem apparently.


Install EtreCheck and post the report. Allow Full Disk Access.

https://etrecheck.com/

Use the Additional Text icon to paste in the report.


Jun 6, 2022 3:46 AM in response to wolfii2

Has these at least attempted the Create a New User account suggested earlier to Test if the issue is is User Account or System Wide issue.


Very much agree with previous suggestion.


Etrecheck


Suggest downloading the Application Etrecheck directly from a well Respected ASC Contributor. And Safe to use.


The application is free or paid from added features. 


Run the application with Full Disc Access ( Security & Privacy - Full Disc Access ).



It will take a Snap Shot -  both the hardware and software.


 The Report will Not Reveal Any Personal Information. 


Post back the Full Report - copy and paste - using the Additional Text Icon ( 3rd Icon to last )



We can have a look at the report for possible issues and may have possible suggestions to resolve the issues.

Jun 4, 2022 6:38 AM in response to Owl-53

Hello,


sorry for the long delay.


The boot in safe mode and back to normal mode did not solve the issue. Neither did the latest macOS updates.


Working on a dummy account for some time is unfortunately not possible as I use this device for my professional work and it would take a lot of time to set up everything I need for my work on a separate account. Furthermore the storage of my mac does not have enough free space for it.


At least I took analysis data of the systemstats process once immediately after starting it and a second time when it consumed 25GB of memory. Find the result here:


maybe this could be helpful.


As a workaround I now created a cronjob as root that kills the systemstats process every hour. This is not perfect, but at least I do not need to do this manually all the time.


I ordered a new Macbook pro some days ago. I am thinking of freshly installing the software and only copying the parts of my data I need instead of using the migration assistant as I did all the years before. Maybe this helps me to not transfer the problem to my new device.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

systemstats memory leak since Monterey 12.3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.