If you only need to know how many times things were called, you could probably record that in much less space. Something like O(log n) of the depth of the stack, instead of O(n) that you need for the actual stack frames.
But I assume that kind of information is probably not enough for Java.
But I assume that kind of information is probably not enough for Java.