Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Tuesday, June 13, 2006

free as in, well, free(1)

The linux tool free(1) just reports how much memory is free (and how much is in use).  Simple, really.  There’s no obvious equivalent for Darwin, though.  We’ve got top(1) which is overkill, and vm_stat(1) which is abstract to say the least.  I wrote a variant of free(1) for Darwin a while back, but never reported on the virtual memory (swap) usage.  Now I’ve found out enough about the Mach virtual memory manager to include that, there’s an updated Darwin free available.  Excuse the manpage, I haven’t updated it to track the new version yet.

I also found out enough about the Mach virtual memory manager to realise that there are a few things I want to change about the dynamic pager.  Without a degree in operating systems design, this might take a while…

posted by Graham Lee at 18:52  


  1. nice. I’d noticed your post on darwin-dev about this.

    Thinking about a darwinport of it?

    Comment by Anonymous — 2006-06-14 @ 10:27

  2. Nigel: I hadn’t been thinking of such, but now that you mention it…maybe I will :-)

    Comment by Graham Lee — 2006-06-14 @ 14:45

  3. Seeing as you’ve become such a vm expert… :)

    I’d like to see someone do a really authoritative article on how to read vm_stat…

    Comment by Anonymous — 2006-06-14 @ 23:31

  4. Give me time….

    BTW, I left a comment on your ‘sleepimage’ post, but I’m not sure that it actually stuck. Is it in some mod queue somewhere, or does your blog software not like Omniweb?

    Comment by Graham Lee — 2006-06-15 @ 08:37

  5. Not sure. it’s not showing up in the mod queue… and I’ve disabled modding comments since I got the SCode plugin working with blojsom.

    Comment by Anonymous — 2006-06-16 @ 04:40

  6. free main.c
    31 pageSize=4096; -> getpagesize();


    Comment by Anonymous — 2006-10-24 @ 20:01

  7. what’s darwin-dev ? i mean, just email me back with the link, is it or or something?

    Comment by Anonymous — 2006-12-15 @ 03:04

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress