* https://docs.oracle.com/javase/7/docs/api/
2. Java Virtual Machine
- an abstract computing machine
- a program that looks like a machine
- knows only of a particular binary format, the class file format.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html
3. Understanding Java Garbage Collection
1) Definition: the process of looking at heap memory, identifying which objects are in use and which are not, and deleting the unused objects.
2) in use object / a referenced object: some part of your program still maintains a pointer to that object
3) unused object/unreferenced object: no longer referenced by any part of your program
4. JVM Generations
1) Young Generation: eden+survivor space
- where all new objects are allocated and aged
- minor GC
2) Old Generation: Tenured
- is used to store long surviving object
- major GC
3) Permanent Generation
- contains metadata required by the JVM to describe the classes and methods used in the application
- Java SE library classes and methods may be stored here.
- full GC
5. The Garbage Colletion Process
1) allocated to the eden space with any new Objects, S0/S1 start out empty
2) when the eden space fills up, a minor gc is triggered
3) Referenced objects are moved to the first survivor space. Unreferenced objects are deleted when the eden space is cleared.
4) we now have differently aged object in the survivor space.
5) the same thing happens for the eden space
6) After a minor GC, when aged objects reach a certain age threshold (8 in this example) they are promoted from young generation to old generation.
7) As minor GCs continue to occur objects will continue to be promoted to the old generation space
* 6), 7): promotion
8) Eventually, a major GC will be performed on the old generation which cleans up and compacts that space.
댓글 없음:
댓글 쓰기