ini_get("memory_limit"); mi sembra

Prova con

ini_set("memory_limit", "50M");

Per settare la memoria ad un valore più alto