Better memory management in P. Earley test