انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-002-L02

الأجيال وجذور GC وقابلية الوصول

  • الدرس 2 من 7
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

explain how the GC decides what is garbage.

الموضوعات المخطط لها

  • An object is live if reachable from a GC root: thread stacks, static fields, JNI references.
  • Weak generational hypothesis: most objects die young, so collect the young generation often and cheaply.
  • Survivors are copied between survivor spaces; after enough collections they are promoted to old.
  • Old generation is collected less often; a leak shows up as old-gen growth.
  • Unreachable cycles are collected; reference counting is not used.
تفاصيل المخطط المبدئي

عرض عملي

a diagram: roots -> objects; Eden -> Survivor -> Old; an unreachable island marked as garbage.

اختبر فهمك

Is an object in a static map live?

أظهر الإجابة

Yes, while the map is reachable from a static root, even if never read.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.