For a statement in a Java function:
Xxx xxx = new Xxx() {
public Abc abc(final Writer out) {
return new SomeFunction(out) {
boolean isDone = false;
public void start(final String name) {
/* blah blah blah */
}
};
}
};
Which variable, including the functions, are put on the heap, and which will be put on stack?
The reason I'm asking this is a segmentation fault in the JVM:
kernel: java[14209]: segfault at 00002aab04685ff8 rip 00002aaab308e4d0 rsp 00002aab04685ff0 error 6
00002aab04685ff8
and 00002aab04685ff0
are near, it seems that the stack is growing too fast. I try to investigate this part of code, and doubt whether it is the cause of problem when calling this function for many times. Is it possible that the stack is not cleared if it is referenced by some variables on the heap?