[] Java java memory reading

Refer to vamei java memory management and garbage collection

java memory stack memory and heap memory is divided into two parts,

  • Stack memory main store some parameters, local variables and return addresses, parameters and local variables is the most basic type of variable, if it is a reference type, there are actually stack is the object reference class, real class A heap memory, stack frame (variable memory module) and is used and clear, running on empty the finish but not the same heap
  • The main heap memory heap storage class variable number of reference types, and does not take the initiative to clear after the completion of the program, are generally cleared by gc jvm mechanism, although the increase in running time but avoid a lot of bug generation, especially the memory leak related

Guess you like

Origin www.cnblogs.com/china-flint/p/10948325.html