java-java memory division

java required memory divided into a part 5 : 
1, the stack (Stack) : the method are stored in the local variables. The method of operation must be run in the stack which
local variables: parameters of the method, or a method inside of {} Variable
Scope: once goes out of scope, which immediately disappeared from the total memory
2, the stack (Heap) : all new things out , which are placed in the stack
things heap memory which has a hexadecimal value of the address
data among the heap, have default values default
1, if it is integer type, the default is 0.
2, if a floating-point type, the default 0.0
3, if it is character type, the default is '\ u0000'
. 4, if the Boolean type, defaults to false
. 5, if the reference type is the default null is
3, the method area (area method,) : storing bytecode .class Related information, the information includes method
4, native method stacks (native method, stack) : information related to the operating system
5, a register (the PC the register) : information related to the CPU
memory map of an array

 

 Two memory arrays of FIG.

 

The same two reference points to a memory array of FIG.

 

 

Guess you like

Origin www.cnblogs.com/jingdenghuakai/p/12345325.html