doc.go 564 B

1234567891011121314151617
  1. /*
  2. Package memsize computes the size of your object graph.
  3. So you made a spiffy algorithm and it works really well, but geez it's using
  4. way too much memory. Where did it all go? memsize to the rescue!
  5. To get started, find a value that references all your objects and scan it.
  6. This traverses the graph, counting sizes per type.
  7. sizes := memsize.Scan(myValue)
  8. fmt.Println(sizes.Total)
  9. memsize can handle cycles just fine and tracks both private and public struct fields.
  10. Unfortunately function closures cannot be inspected in any way.
  11. */
  12. package memsize