понедельник, 1 января 2024 г.

Memory allocation in Java

 The Java Memory Allocation is divided into following sections :

  1. Heap
  2. Stack
  3. Code
  4. 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.


    Комментариев нет:

    Отправить комментарий