My breakpoint points to a variable. (points somewhere. Can I figure out if somewhere belongs to the heap or the stack?)
is there any way to find where is the beginning and the end of the stack? is there any way to find where is the beginning and the end of the heap?
Stack and a Heap ? Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer's RAM . Variables allocated on the stack are stored directly to the memory and access to this memory is very fast, and it's allocation is dealt with when the program is compiled.
So, all input arguments and all local variables for a function/class method are placed on the stack.
JVM has divided memory space between two parts one is Stack and another one is Heap space. Stack space is mainly used for storing order of method execution and local variables. Stack always stored blocks in LIFO order whereas heap memory used dynamic allocation for allocating and deallocating memory blocks.
If the heap grows into the stack, the operating system should always be aware of the situation and some sort of system call will fail. The implementation of malloc() almost certainly notices the failure and returns NULL .
Use info proc mappings
for /proc
info about your memory layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With