简体   繁体   中英

How much memory does one stack of a recursive call in Java take?

How much memory does a stack of a recursive call take? What does it depend on, and how do I find the exact amount of memory used by a particular recursive stack in Java

A strack frame contains:

  • a return address
  • a base pointer
  • enough space for all the parameters and local variables that are declared in the method concerned, remembering that object-valued variables are references to objects, not objects.

This is almost always trivial.

There is no method in Java (at least short of the debugger API) that will tell you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM