Skip to main content

memlab analyze unbound-collection

Check unbound collection growth (e.g., Map with growing number of entries)

memlab analyze unbound-collection 

Example output​

$ memlab analyze unbound-collection --snapshot-dir /tmp/memlab-example/series/data/cur
Top growing objects in sizes:
 (Use `memlab trace --node-id=@ID` to get trace)

· Set [object](@47967):  1 > 2 > 2 > 3 > 3 > 4 > 4 > 5 > 5

How to read the output​

memlab analyze unbound-collection compares a series of snapshots of the same page and lists the collections (Map, Set, and arrays) whose number of entries keeps growing.

Each line is the collection and its id, then its number of entries in each snapshot in order. Here the scenario opens and closes the settings dialog 4 times, taking a snapshot after each step. The openedDialogs Set gains one entry each time a dialog opens, and loses none when it closes. A collection that grows with every repetition of an action, and never shrinks, is a likely leak.

Options​

  • --snapshot-dir: set directory path containing all heap snapshots under analysis

The universal options (--help, --verbose, ...) work with this command too.