تفريغات الذاكرة
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
capture and analyze a heap dump for large retainers.
الموضوعات المخطط لها
- Capture:
jcmd <pid> GC.heap_dump file.hprof; it pauses the app and creates a large file; handle carefully (may contain secrets). - Open in Eclipse MAT or VisualVM.
- Shallow size is the object itself; retained size is what would be freed if it went away.
- Dominator tree lists biggest retainers; "path to GC roots" explains why it is live.
- Compare two dumps to find growth.
تفاصيل المخطط المبدئي
عرض عملي
dominator tree: ConcurrentHashMap retaining 480 MB of Product.
اختبر فهمك
What is retained size?
أظهر الإجابة
Memory that would be freed if that object were removed.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.