About the value of "Memory" indicated by activity monitor

When I run the daemon program I created for several hours, the value of "Memory" indicated by Activity Monitor is higher than expected. The program releases unnecessary memory.

  • What does this "Memory" value mean?
  • If the value of "Memory" continues to increase, is the application leaking memory?
  • I am using Instruments to detect memory leaks. Can Instruments Detect All Memory Leaks? Is there any other way to detect memory leaks?
  • What is the difference between the VSZ value displayed by the ps command and the "Memory" value?


macOS 10.14.2

Replies

What does this "Memory" value mean?

On recent OS releases, the value shown in the Memory column of Activity Monitor is the process’s footprint. You can learn more about this value in this post and the resources it references.

If the value of "Memory" continues to increase, is the application leaking memory?

What application? I thought you were talking about a daemon?

In the case of a daemon, a steadily increasing footprint value is bad because a daemon is a long-running process. It’s fine for the footprint of a daemon to fluctuate as its doing work, but if it steadily increases then eventually its will start affecting the system as a whole.

This may or may not be a leak — it could be another problem, known as abandoned memory — but it’s definitely something you need to investigate and resolve.

I am using Instruments to detect memory leaks. Can Instruments Detect All Memory Leaks?

No. But, regardless, leaks are not the only way for the footprint to grow. I recommend that you use the generations feature of the Allocations instrument to look for memory growth in general. See Find abandoned memory in Instruments Help.

What is the difference between the VSZ value displayed by the ps command and the "Memory" value?

Understanding specific memory statistics requires you to understand how the VM system works, which is hard (the VM system is complex in and of itself, and it also changes regularly). I recommend that you focus on the footprint for the moment.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"