The Java Memory Allocation is divided into following sections :
- Heap
- Stack
- Code
- Static
This division of memory is required for its effective management.
- The code section contains your bytecode.
- The Stack section of memory contains methods, local variables, and reference variables.
- The Heap section contains Objects (may also contain reference variables).
- The Static section contains Static data/methods.
Object gets the memory in heap memory area. The reference variable refers to the objects allocated in the heap memory area.
Комментариев нет:
Отправить комментарий