انتقل إلى المحتوى
أمين أبوزيد
MID-008

تحليل الأداء

  • 8 درس
  • 4 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

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

نظرة عامة

الموضوعات

  • JFR
  • JDK Mission Control
  • تفريغات الذاكرة (heap dumps)
  • تفريغات الخيوط (thread dumps)
  • تحليل استهلاك المعالج (CPU profiling)

تعلّم أولًا

4 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Record and analyze a JFR recording in JDK Mission Control.
  2. Find CPU hot spots with flame graphs.
  3. Capture and read thread dumps to diagnose blocked or starved threads.
  4. Capture and analyze a heap dump to find large retainers.
  5. Follow a measure → hypothesize → change → re-measure loop.

الدروس

  1. 01قِس قبل أن تحسّن
  2. 02Java Flight Recorder
  3. 03جولة في JDK Mission Control
  4. 04تحليل المعالج والرسوم اللهبية (Flame Graphs)
  5. 05تفريغات الخيوط
  6. 06تفريغات الذاكرة
  7. 07عرض عملي: إيجاد نقطة الاختناق في نقطة نهاية بطيئة باستخدام JFR
  8. 08عرض عملي: تجويع الخيوط في خدمة حية

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

Lab

MID-008-LAB1 · Profile Shop

Outcomes: 1–5 · Time: ~4 h The instructor plants a CPU hot spot and a lock contention in Shop. Using recordings, thread dumps, and (if needed) a heap dump, find both without reading the source first, fix them, and show before/after evidence under the same load. Acceptance: written investigation log.

Exercises (assessment: investigation of an unseen recording)

IDOutcomeTask
MID-008-EX011Record Shop for 2 minutes with JFR; list the five most useful pages or views and one finding from each.
MID-008-EX022From a provided flame graph, name the hottest method, its caller, and a hypothesis.
MID-008-EX033From three provided thread dumps, identify the contended lock, its owner, and the blocked threads.
MID-008-EX044From a provided heap dump, name the largest retainer and explain why it stays live.
MID-008-EX055Write a four-line investigation log entry for a fix: symptom, evidence, change, before/after.
MID-008-EX065List three ways a measurement can mislead (cold start, debug mode, single run) and how to avoid each.
أظهر الحلول
  • EX01 For example: Automated Analysis, Method Profiling, Memory/GC, Lock Instances, Threads; each gives a lead (hot method, allocation rate, pause, contended monitor, parked pool).
  • EX02 The widest top-level frame; its parent frame is the caller; hypothesis, for example, repeated regex or formatting per call.
  • EX03 Find the monitor address shown as "waiting to lock"; the owner is the thread with "locked" on the same address; list the blocked threads.
  • EX04 Dominator tree top entry, with the path to GC roots (typically a static or singleton field).
  • EX05 A complete entry has a measured symptom (p95 numbers), the evidence artifact, a single change, and re-measured numbers under the same load.
  • EX06 Cold start: warm up first. Debug mode: profile production-like settings. Single run: repeat and compare distributions.

الاختبار

Outcomes: O1 JFR and JMC · O2 flame graphs · O3 thread dumps · O4 heap dumps · O5 measurement loop.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1The correct loop is:O5
  2. 2JFR is notable for:O1
  3. 3Command to start JFR on a live process:O1
  4. 4First place to look in JMC:O1
  5. 5In a flame graph, frame width shows:O2
  6. 6A wide frame at the top of a stack means:O2
  7. 7Many threads BLOCKED on the same monitor indicates:O3
  8. 8Why take several thread dumps?O3
  9. 9Retained size of an object is:O4
  10. 10To explain why a leaked object stays alive, use:O4

الجزء العملي

Six exercises MID-008-EX01 to EX06 including an unseen-recording investigation, plus the lab investigation log. Pass: at least five exercises correct and a log showing evidence, one change per iteration, and before/after numbers for both planted problems.

أخطاء شائعة

Optimizing by intuition; profiling in debug mode; one-off measurements.

التقييم

Investigation of an unseen recording.

الصلة بالمسار الوظيفي

Performance engineering (SRC-016) and the MID graduation gate.

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