Java memory


RAM (Memory)

  • Java the memory is divided into two, one called the stack memory, called heap memory;

1. The memory stack (Stack)

  • The method used runtime memory, such as main operation method, the method into the execution stack;
    each method in the stack memory has a separate stack space, after popping method will disappear;
    store local variables (i.e. variable grade method);

2. heap (Heap)

  • Storage object or array, storing member variables (object instance-level variables), to create the all new, are stored in the heap memory;
  • Created on the heap are reference types;
Published 59 original articles · won praise 60 · views 1573

Guess you like

Origin blog.csdn.net/Regino/article/details/104559282