What.. you want someone to go through all of our code to find your implementation issues?
My consultation fees start at $150 per hour, with a $250 retainer.
But for free, I can tell you that it is likely nothing to do with PHP at all. How do you know it is a RAM issue?