posted 19 years ago
So, suppose i instantiate an object in a method, the object itself is created on the heap, but the reference to it on the stack. and when i return from the method, the reference is de-referenced, and so the object becomes available for garbage collection.
is the amount of memory to both fixed? meaning, in essence, if i run a recursive method with many recursions, i am putting it all on the stack, right? so, if the stack runs out of memory, but the heap has some memory left, can the stack utilize this memory?