Hi,
The adaptive integrator multi-dim is designed to work for low dimensions (e.g. 2,3,4), and not really for higher like 6. You can try to use the MC integrator based for example on VEGAS, it should use less memory and work better in this case. See the example code here:
However, the fact that is running out of memory is due to a massive memory leak in your code. You are
creating for each function evaluation TGraph and TF1 objects without deleting them. I would recommend to create these objects outside the function evaluation code, and re-use them every time you need to compute the function f(x)
.
Best regards
Lorenzo