Java stack create new frame for every method call, But does this frame takes memory on the stack?
To clarify on my question :
public void oneWay()
{
System.out.println("start");
get1();
}
private void get1()
{
System.out.println("get1");
get2();
}
private void get2()
{
System.out.println("get2");
}
Output of this is same as :
public void anotherWay()
{
System.out.println("start");
System.out.println("get1");
System.out.println("get2");
}
But does second snippet takes more memory on stack or equal? In short, does stack frame take memory?
EDIT : How much memory does a stack frame take? Is there any specification by Sun, now Oracle?