عرض عملي: اكتشاف تسرّب بلقطتين للـ Heap
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
locate a leak by diffing dumps; prepares MID-002-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Start Shop with GC logging and the planted cache; run steady load.
- Confirm in the log that the post-GC floor keeps rising.
- Take dump A (
jcmd <pid> GC.heap_dump a.hprof), run load a few more minutes, take dump B. - Open both in Eclipse MAT or VisualVM; compare histograms and find the class with growing instance count.
- Planned mistake: raise
-Xmxfirst and declare it fixed because the crash is later. Fix: follow the path to GC roots (dominator tree, "path to GC roots") to the static map. - Bound the cache (size limit/eviction), rerun, and show a flat floor.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.