0

Recently I am recording the amount of data written in my SSD from kernel_task on my new M1 MacBook because that is the main source of memory swapping. I found that memory swapping is less when the MacBook is newly booted up, and more when I don't shut down for a few days. memory data However, I cannot find any relation why that is the case, or is that just a coincidence? I also got similar results when I use iStatMenus 6. Here is the recent 7 day results (white portion is when the computer is shutted down): enter image description here It seems like kernel_task is writing more the longer I leave it on, but I don't see any correlations between the two. I am using similar apps each day. Also, I am currently not worried about my SSD life because it is only writing 30GB per day max, and I have 100% SSD lifetime. Thanks for answering.

4
  • I'm not sure what your actual question or concern is. My system writes about 1.5TB a week to the SSD. As for how memory is handled see this I just wrote for graphicdesign.se - graphicdesign.stackexchange.com/a/147500/115385 - & note that swap is not handed back in any great degree. Consider it a high tide marker rather than a current figure. You can always expect it to trend upwards [though it might move a little either way] BTW, the M1's design is to optimise swap as though it were RAM, as both are in essence on 'the same chip'.
    – Tetsujin
    Commented May 5, 2021 at 17:41
  • @Tetsujin What is the difference between Swap Used and Bytes Written in kernel_tasks?
    – CELLSecret
    Commented May 5, 2021 at 18:54
  • They're not really connected. You still haven't actually explained what your question is. Ask Different needs one clear question with one or more distinct answers, one of which you can choose as 'accepted'. Right now we have no clear question, no actual response to requests for details in comments & an answer, also gaining new questions beneath it.
    – Tetsujin
    Commented May 5, 2021 at 19:00
  • so my question is why does swap memory increase the longer I leave the mac on which is kinda explained by the question which I chose as accepted.
    – CELLSecret
    Commented May 5, 2021 at 19:40

1 Answer 1

1

kernel_task is not an actual process like the others you see in Activity Monitor, it is a kind of “virtual process” that actually represents the kernel itself.

This means that it is not kernel_task itself that performs some job and in the process writes to disk, rather the kernel is continually (many, many times per second often) asked by your running programs to do stuff on their behalf.

You won’t find any “template” or “fixed model” for how kernel_task behaves, as that depends on whatever the rest of the programs on your computer is doing.

You also write about swapping. This is done when the amount of free RAM is not sufficient to cover the requests from running programs. These requests are dependent on whatever you’re doing with your computer. For example if you’re running a web browser, some sites might require almost no RAM to display - and others might require lots and lots of RAM.

As for why it tends to be more after running your computer for a long time - that is actually quite logical. Over time you have probably run more and more different programs, have more things loaded in (open documents, web site tabs, etc), and even more that contribute to your total RAM Usage than when you just booted the computer.

Some programs might also leak memory due to bugs This means that long running programs request some memory, and then forget about it, never giving it back to the operating system, even though they’re no longer using it. The longer you keep programs running, the more leaks you’ll eventually have. You can reclaim the leaked memory by closing the program - or by rebooting the computer.

1
  • Ah that makes sense. I have another related question: I have currently 13 tabs open on Chrome and there are 16 Google Chrome Helper (Renderer) in the Activity Monitor. Does it mean that there is a helper for each tab? Why is there 3 more helpers? How do I know which tab the helper is "helping" so that I can close it when it is occupying lots of memory? I am generally using similar sites and programs on my Mac, and I always quit the app after using it. So I am surprised that the memory swap usage differs that much.
    – CELLSecret
    Commented May 5, 2021 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .