I have the excact same problem.
And I followed the perfect_setup_debian_sarge guide.
Also made sure that Bison, flex, gcc, zlib, libmysql12-dev, g++, cpp are all installed and up to date.
I use a 32-bit linux build and have no mem-problems.
I really have no Idea what to try next