Actually it would not be too difficult to have ADMB do all this automatically. One could do one "fake" function evaluation and keep track of the amount of memory buffers needed and allocate them. The user could optionally input a maximum amount of memory to be used. that was what I had intended to do ... one day.