In version 5 I think you can set memory size, e.g.
(all one line, may display here as wrapped. Also this system seems to want to insert an extra space in "istack"):
build {rstack=1000000,cstack=1000000,sstack=1000000,istack=1000000}
Back when we used version 5 we would put the above in our startup.ms file. Maybe that will help.