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

JVM داخل حاوية

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

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

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

في هذا الدرس

size heap and container limits so they fit together.

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

  • Modern JVMs read cgroup limits; the default max heap is a fraction of container memory.
  • Set it explicitly with -XX:MaxRAMPercentage (for example 60-75), not a fixed -Xmx that ignores the limit.
  • Heap is only part of process memory: metaspace, thread stacks, code cache, direct buffers also count.
  • If total exceeds the limit, the container is OOM-killed (exit 137), with no Java exception.
  • Set CPU limits knowing they change the GC and compiler thread counts.
تفاصيل المخطط المبدئي

عرض عملي

text
container limit 1 GiB -> MaxRAMPercentage=70 -> heap ~700 MiB, ~300 MiB left for non-heap

اختبر فهمك

Why can a pod be killed while heap usage looks fine?

أظهر الإجابة

Non-heap memory pushed the process over the container limit.

التطبيق

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

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

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

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