[Posts] JVM - illustrated articles

JVM - graphic papers

https://www.jianshu.com/p/1353d0a64346

 


32019.07.13 22:49:58 read 80 words 992

Long, long ago, that is, in March 1992, there is a NB roaring coffee school was born, its name JAVA, the school's rules and regulations is extremely powerful, the average student will lose heart, the only top student like people who can stay, do not I guess the man is "you."

The character appeared list

Full name Aliases Abbreviation
school Java Virtual Machine JVM
Classroom Heap space Heap
teacher Garbage collector Minor GC / Major GC
student data Object

School plan

 
Common name Permissions Abbreviation
Eden classroom newborn Eden
Survivor0 / 1 classroom Honors S0S1
Tenured / Old Generation classroom Top student dedicated Old
Metaspace classroom Students, principals special Metaspace

Welcome Freshmen school blackboard

  1. This newborn receive job log. Remarks :( record whether students had done their homework done once every cover a chapter ).

  2. Next to the newborn itself venue  Eden classroom.

  3. Minor GCThe teacher checks will continue to have no homework, do not be labeled teacher.

  4. Not being labeled a top student, to its own venue  S0 or  S1 classroom, notes :( these two must have a classroom is empty, the students can not directly enter an empty classroom empty classroom teacher in charge of arrangements entered by the Minor GC ), the venue End after the expulsion  Eden of the classroom poor students.

  5. Both classroom Minor GCteacher will continue checks, do the job of another venue in the classroom after the teacher named in the order to sit, not doing homework students to stay after school to do ideological education and then expelled.

  6. Minor GCThe teacher checks once per job, plus give you a point, if the score reaches a specified score, you can enter the top students in  Old the classroom.

  7. S0Or S1classroom full of people after, congratulations mixed group of people can become a top student, be the venue to  Old the classroom, there will be another Major GCteacher responsible for checks, no Minor GCteacher tube so strict, happy now.

  8. If the job has been recorded this record students' full, very sorry, will also be dismissed, because our school free of trouble, do not bother to give you the job made this record.

  9. MetaspaceClassroom, or if you have something to students on the go with the president, without fear of being fired, ha ha.


Welcome Freshmen school blackboard Insider

  1. Used to record the creation of objects  GC年龄, each  GC one still alive after one year plus.

  2. All newly created objects are in the  Eden area.

     

     

  3. Minor GC Will check whether the object is still quoted, it is not marked.

     

     

  4. Performed Minor GClater, Edenthe live objects are moved to S0or S1region.

     

     

  • After moving, Minor GCthe Edenarea cleared, and the survival age is incremented by one.
     
  1. Second Minor GC, repeatedly performed (3, 4) step, this time another S1area to come in handy.
     
  • Clear


     
  • Performed once again Minor GClook at the renderings.

     

     

  • Clear


     
  1. Old generation system setting is assumed age 4 years, the data No. 3 can be upgraded to the old generation area.
     
  • Clear


     
  1. SurvivorAfter full transfer area directly to Tenrued/ Old Generationbelow this case it wants, Survivorthe region which objects are alive, and not enough space to store up.
     
  • Clear data


     
  1. Assuming that age old generation system settings is 20 times, then, after the twentieth, will be cleared Major GCit will be processed automatically labeled.
     
  • Remove


     
  1. MetaspaceArea, belongs to the GC Roots.
虚拟机栈(栈帧中的本地变量表)中引用的对象。
方法区中类静态属性引用的对象。
方法区中常量引用的对象。
本地方法栈中JNI(即一般说的Native方法)引用的对象。
  1. If Old Generationtoo full, I will report you often see OOMthe anomaly.

Real-life example

1. Zhangsanlisi first day students come to this JVMschool

# 教室里只有他们两人
Object zhangsan = new Object(); Object lisi = new Object(); 

2.'ll find a lovely teacher said the purpose of solving the problem of students

# zhangsan说我会,然后
zhangsan.do(); 
  • This time the Minor GCteacher appeared.
# 发现lisi在那里傻傻的发呆,不会做作业就会看
# GC老师直接标记它为没用之人,zhangsan标记为有用之才。
  • Minor GCTeacher Disciplines execution
# 告诉zhangsan去隔壁的`S0`教室继续做题
# 拿出化骨水化掉了lisi

3.zhangsan came to the S0classroom

# 教室越来越多人,已经挤不进人了
# Minor GC老师又给没用的人进行标记,他又成功躲过了这次
# 老师告诉他去`S1`教室继续做题,他要化人了

4.zhangsan came to the S1classroom

# 经过了几轮的S0/S1教室来回跑,他已经躲过了15次了
# `Minor GC`老师告诉他,你可以去尖子班做题了

5.zhangsan came to the Tenrued/Old Generationclassroom, where the Major GCteacher really do not often see us.

# zhangsan在这里又避免了5次的化骨水,但时间却花了比之前的几十倍
# 最后zhangsan还是被化掉了,因为前后加起来、太老了,伤不起。

ZhangSan GameOver whole end of the play

PS Note: This article belongs to the simple knowledge JVM illustration, easy to understand, but the JVM content there very much, here tip of the iceberg.

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/12606247.html