Looking for info on making recursions eat less stack.
- To: mathgroup@smc.vnet.net
- Subject: [mg11150] Looking for info on making recursions eat less stack.
- From: "Barthelet, Luc" <lucb@ea.com>
- Date: Mon, 23 Feb 1998 21:41:09 -0500
under Win95 with 128 Mb of RAM I have some Mathematica code that use a function recursively. at a depth of about 500, the kernel dies. ( I raised $RecursionLimit). I am currently assuming that it is because I eat up too much stack. Is there any info about what to do to get a recusive function to consume less stack? I kept the number of local variable to a minimum. the ByteCount of the local variables plus the parameters of the function is 2736 (which is quite a bit). Still I should be able to go to deeper than 500. Also $RecursionLimit warning message does not match the actual deph, but seems to be about 4 times deeper than my function. Does that make sense? thanks.