Skip to content
/ gomem Public

Utility for recursively determining memory consumption of generalized structs in Go.

Notifications You must be signed in to change notification settings

dwasse/gomem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GoMem

GoMem is a minimalistic utility for determining the size of a generalized struct in Go.

After doing some memory profiling, I was frustrated with how little tooling there is for determining the total memory consumption of a variable in Go, so I made a utility to do just that. gomem.GetMemoryConsumption() takes an arbitrary struct as an interface and recursively records the memory consumption of all fields, dereferencing all pointers.

To run tests, do go test.

Feel free to let me know if you find any errors in the code- it's certainly been useful to me!

About

Utility for recursively determining memory consumption of generalized structs in Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages