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