Przejdź do treści
Biblioteka skilli
Programowanie · Analiza

profiling-memory

/profiling-memory

Przypisuje wzrost pamięci i nadmiar alokacji do konkretnych miejsc wywołań za pomocą profilera alokacji, gdy proces rośnie bez końca lub nadmiernie obciąża garbage collector.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Przypisuje wzrost pamięci i nadmiar alokacji do konkretnych miejsc wywołań za pomocą profilera alokacji, gdy proces rośnie bez końca lub nadmiernie obciąża garbage collector.

Oryginalny opis (EN)

Attribute memory growth and allocation churn to the exact call sites that produce it using an allocation profiler. Use when a process grows without bound, spends too much time in garbage collection, or allocates far more than its working set explains.

Jak działa

  1. Method
  2. Signals
  3. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 51 linii, 447 słów
Podgląd SKILL.md
---
name: profiling-memory
description: Attribute memory growth and allocation churn to the exact call sites that produce it using an allocation profiler. Use when a process grows without bound, spends too much time in garbage collection, or allocates far more than its working set explains.
---

# Profiling memory

Memory problems come in two flavors that look identical from the outside: you
keep objects you should have dropped, or you allocate and free at a furious
rate that the collector cannot keep up with. Total usage tells you something
is wrong; only an allocation profile tells you which line to change.

## Method

1. **Decide first: live growth or allocation rate.** A heap that climbs and
   never falls is retention. A flat heap with high garbage-collection CPU is
   churn: short-lived objects born and killed in a loop. Watch RSS over time
   and the GC pause log to tell them apart before choosing a tool.
2. **For retention, take two heap snapshots and diff them.** Capture one
   after warmup and one after the leak has grown: `jmap -dump` then Eclipse
   MAT for the JVM, `tracemalloc.take_snapshot().compare_to(...)` in Python,
   Chrome DevTools heap snapshots for Node. The diff names the object type and
   the retaining path that is holding it alive.
3. **For churn, run an allocation profiler that keeps stacks.** `memray run
   app.py` for Python, `async-profiler -e alloc` for the JVM, `heaptrack
   ./app` for native code. These sample allocations with the call stack, so
   the flame graph shows which call site allocated the bytes, not just how
   many.
4. **Rank by allocation count, not only by size.** A million tiny objects
   costs more in GC pressure than one large buffer of equal bytes. Sort the
   profile by number of allocations to find the loop creating temporaries:
   boxed integers, intermediate lists, format strings, defensive copies.
5. **Follow the dominator tree to the real owner.** In a snapshot, the object
   at the top of memory is often innocent; the dominator, the single node
   whose removal frees the whole subtree, is the cache, listener list, or
   static map that never releases. Break that one reference and the subtree
   collapses.
6. **Fix the site, then confirm the curve flattens.** Pool the buffer, reuse
   the object, drop the stale reference, or bound the cache. Rerun the same
   workload and watch RSS plateau or GC time fall; if the curve still climbs,
   the diff pointed at a symptom and a second retainer remains.

## Signals

- Can you name the type and the call site responsible for the most bytes?
- Does the retaining path lead to something you can legitimately release?
- After the fix, does RSS reach a steady state under the same load?

## Boundaries

Profilers attribute managed and instrumented allocations; memory lost by a C
extension or a raw `mmap` outside the runtime stays invisible, and native
leak detection (Valgrind, ASan, LeakSanitizer) covers that ground. This skill
locates allocation; whether an object should live that long is design.

Wersje

W bazie nie ma innych skilli o nazwie profiling-memory.

Migawka bazy z 13.11.2026 · wersja paczki 76ea2dbaa0f8 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90memory-optimization
    Zmniejsza zużycie pamięci programu przez poprawę układu danych, ponowne użycie alokacji i strumieniowanie wejścia, gdy proces ginie przez OOM killera lub dominuje garbage collection.
  • 100jvm-gc-selection
    Dobiera i dostraja garbage collector JVM do celów opóźnień i wzorca alokacji oraz pomaga czytać logi GC przed zmianą flag.
  • 100heaptrack
    Profiluje pamięć na Linuksie narzędziem heaptrack: śledzenie alokacji sterty, wycieki pamięci, szczytowe użycie, gorące punkty alokacji i porównanie zachowania alokacji między uruchomieniami, w tym heaptrack_print.
  • 100unity-performance
    Pomaga profilować i optymalizować Unity 6: liczbę klatek na sekundę, zużycie pamięci i wąskie gardła przy użyciu Profilera, Memory Profilera i Frame Debuggera.
  • 87optimize-memory-allocation
    Analizuje profile alokacji pamięci w JVM w zymtrace, wskazuje miejsca najczęstszych alokacji i przyczyny zbyt zajętego GC.
  • 95nodejs-profiling
    Profiluje wydajność Node.js za pomocą profilera CPU V8, analizy sterty i perf_hooks, żeby znaleźć wąskie gardła, wycieki pamięci i opóźnienia pętli zdarzeń.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.