You might need to give tex more main memory: http://tex.stackexchange.com/questions/75399/increasing-texs-main-memory