I've got a few more questions about this, hope you dont mind helping:
1) You say a memory leak is a bug, is it my bug or a maple bug (in this case something about the way that eval handles integration)?
2) you say I should ensure that functions evaluate ok under evalhf (or evalf in this case I think because the operator form of Global optimisation uses evalf rather than evalhf). Is there a way to check for this directly?
3) In an earlier post you talk about "fixing" the objective function so it doesnt rely on lexical scoping of 'data', what do you mean by this?
Ps I tried a single symbolic integration followed by repeated substitutions in & that definitely prevents the memory blow up. So I guess this is the root of the problem.