As you say, local variables and references are stored on the stack. When a method returns, the stack pointer is simply moved back to where it was before the method started, that is, all local data is "removed from the stack". Therefore, there is no garbage collection needed on the stack, that only happens in the heap.
To answer your specific questions:
- See this question on how to increase the stack size.
- You can limit the stack growth by:
- grouping many local variables in an object: that object will be stored in the heap and only the reference is stored on the stack
- limit the number of nested function calls (typically by not using recursion)
- For windows, the default stack size is 320k for 32bit and 1024k for 64bit, see this link.