In my opinion (given my superficial understanding of the prior situation), your problem was Apache + mod_php. The default settings for that combination are to chew memory until the bad people go away.
Out of curiousity, why middleman when you're already using Jekyll/Octopress?
(My dog in the static site generator fight is Nanoc, fwiw).