Activity Monitor Log

I’m currently using Activity Monitor to log the RAM loading on my computer - the company that I work for wants to buy me a new Mac (Yay!) but the IT guys (who know nothing about Macs) want me to tell them what my high, low and median RAM usage is so that they can work out a spec for what Mac to get me (bah!).

This is the bit of the Actvity Monitor Screen that I’m particularly interested in …

Does anyone have a script that will look at Activity monitor, say, every 5 or 10 minutes or so during the day and then create a log file in something like TextEdit, saving it onto the desktop with the load figures in it?

I’d write one myself but this is a bit beyond my abilities!

I wouldn’t recommend to use AppleScript.
I would look for a solution that use unix commands like ps or top to get the state of memory used at specific time.

This script is not a solution but it does get static text from Activity Monitor.
I changed the time to be shorter, so I could get 48 items in less time.

set timesToRepeat to (8 * 60) / 10 as integer
set timeDelayInMinute to 1 -- should be 10

set memoryUsedList to {}
repeat timesToRepeat times
	set memoryData to getMemoryUsed()
	set the end of memoryUsedList to ((item 1 of memoryData) & (item 2 of memoryData)) as string
	delay (1 * timeDelayInMinute) -- should be (60 * timeDelayInMinute)
end repeat

return memoryUsedList

on getMemoryUsed()
	tell application "Activity Monitor" to launch
	delay 5 -- wait for Activity Monintor to start
	tell application "System Events" to tell application process "Activity Monitor"
		set visible to false
		tell window 1 to tell group 1 to tell group 1
			set theTexts to its value of static text
			set {theName, theValue} to {item 3 of theTexts, item 4 of theTexts}
		end tell
	end tell
end getMemoryUsed

Will that save the info into a Text Edit document? I just ran it but it didn’t seem to do that.

The script was not an solution is was more a demonstrate of bad approach.
The result is list so you could convert it to string and tell app text edit to import it.

set theText to ""
repeat with i from 1 to count memoryUsedList
	set theItem to item i of memoryUsedList
	set theText to theText & theItem & return & return
end repeat

tell application "TextEdit"
	make new document with properties {text:theText}
end tell

I have 32GB memory on my laptop and I have lot of things running and my computer never get slow. Its Apple Silicon… The price difference between 15GB vs 32GB is very little.

With unified memory, this becomes less important than it was in the past…Gruber’s latest podcast addresses some of this, and there are a few links in the podcast info which might also provides some insights for you. Daring Fireball podcast