GC+JVM

1. Memory Management Model

① to manage memory object, the memory occupied by the object in each successive section, heap allocation. Object reference can point to other objects in the heap. Non-target basic data types equivalent to the reference data.

② are dynamically allocated based on the stack and heap memory management, that dynamic allocation of memory at run time, create a new memory object. The static memory allocation has been determined at compile good memory allocation.

③ Each thread has its own thread stack, their management, are not visible to each other. Transfer data between multiple threads, rather than by copying the reference. Stack can not support complex data types. All local basic data types are created on the stack.

④ native method stacks, PC

⑤Method Area (hotspot called Perm, a part of the heap, later renamed metaspace) storing class information, a constant, static variable.

Summary of each variable, a reference storage location:

Stack: The method of basic types of variables and their values, the method of reference type variable references

Heap: The method entity object reference type variable, non-static member variables of the class (including the basic type variable, a reference type variable)

The method area (it can be said that the heap): Class information has been loaded in the virtual machine, constants, static variables, the time compiler to compile the code and other data

 The basic concept of the 2.GC

① root object: determining accessibility of the starting point, the object including a register, the static data area, the data referred to in the stack

② up objects (living objects): reachable from the root objects
③ unreachable objects (dead object): unreachable from the root object
④ Phantom: unreachable objects from recycled time
 

Guess you like

Origin www.cnblogs.com/hyfer/p/11075096.html
Recommended