Who’s stealing your memory?

Terminal fiends will likely find this post useful.

A while ago, I was sitting in the library at the University of Florida under the pretense of preparing for a final exam that was scheduled for the following day. I had, however, made the idiotic mistake of bringing my laptop with me.

Instead of studying I became inexplicably fascinated with how much memory my various running applications were taking up. Actually, it was really the fault of Alex Harper’s fantastic MenuMeters application, because I noticed that I was running low on free memory, despite having 2 gigabytes installed and very few applications running.

This lead to another discovery, namely that Safari was hording over a gigabyte of RAM for itself. This upset me, as I’m rather neurotic about how much RAM applications use. Every time the OS has to pageout I cringe inside with the knowledge that my laptop’s battery life, performance, and theoretically, the lifespan of its hard drive, are all affected. So I set aside the textbook and wrote memusage, a shell script that reports back the largest of offenders:

gslepak$ memusage
Top 10 memory intensive apps:

	Name			Percentage	Size

#1:	Xcode                   5.3		217.688 MB
#2:	firefox-bin             4.4		181.754 MB
#3:	WindowServer            4.1		165.961 MB
#4:	Finder                  2.3		95.2305 MB
#5:	iTunes                  2.0		81.7227 MB
#6:	Mail                    1.8		75.7031 MB
#7:	Interface               1.7		67.7344 MB
#8:	coreservicesd           1.3		53.1914 MB
#9:	mds                     1.1		45.0312 MB
#10:	Quicksilver             0.9		38.4531 MB

As you can see, I don’t use Safari anymore. 😛

I wonder what iSpy is using right now…

gslepak$ memusage ispy
ispyd: 0.0 %  0.441406 MB

Ten is too many, just show me the top 5:

gslepak$ memusage 5
Top 5 memory intensive apps:

	Name			Percentage	Size

#1:	Xcode                   5.3		217.688 MB
#2:	firefox-bin             4.5		182.457 MB
#3:	WindowServer            4.1		166.281 MB
#4:	Finder                  2.3		95.2305 MB
#5:	iTunes                  2.0		81.7227 MB

If you’re wondering why the percentages don’t match up with 2GB, it’s because I recently upgraded to 4GB, and I highly recommend it!

memusage

One thought on “Who’s stealing your memory?

  1. Reply

    Daniel Warner

    Dude. That is COOL… and useful.

    Thanks!

Leave a Reply to Daniel Warner Cancel reply

Your email address will not be published. Required fields are marked *