I hope someone can help.
I am using Python 2.5.4 (under python(x,y) umbrella) on XP SP3, and running a grammatical evolution program that runs recursions on equations that grow via nested recursive loops: the program is PonyGE from the google repository: I tried contacting authors to no avail.
The program works, but after a small number of populations, it gets a 'dreaded' memory error if the equations grow too large. If I run it in Ipython I get an additional clue, which is s_push: parser stack overflow.
An example equation that was halted with this error is:
Expand|Select|Wrap|Line Numbers
- return (4 * (2 - (4 * ((((2 + (2 + 0)) + 3) * (((4 + 3) - ((((2 * (3 * 1)) + (4 - (((0 - 4) + (((4 * (((((3 + 0) + (0 + 2)) + 3) * (((0 - 3) * 3) + (5 - (4 + (2 + 1))))) - 3)) - 3) * 5)) + 1))) * 4) - 2)) + 4)) + 1))))
- XXXeval_or_exec_outputXXX=sum([f(x) for x in range(10)]); 8264400
I did some research on other people with this problem, and they said the
parser.c MAXSTACK needed to be upped. Problem is I have no parser.c in my python directory. The other weird thing is the program halts here and only uses 15M of RAM out of 1.5G on my system (3.3Ghz AMD).
One other hint is someone else ran it on linux with no problems. They mentioned it might have to do with the way xp allocates memory vs linux.
Can anyone help?
Thanks so much.
P.S. Sorry, is there a sticky on how to insert code tags? I tried <code></code> and it didn't enclose any code.