Is there a way to trace the memory usage throughout the program using pprof? So I am wondering how I can go about to find out why the program allocates 17 GB, when it seems that the peak memory usage is only ~2.5GB? However, if I run go tool pprof mem.prof I get the following results: (pprof) top5 ![]() This shows the total allocation of the program: Total alloc: 17 GB If I look at the mem stats after running one file through the pipeline: var mem runtime.MemStatsįmt.Printf("Total alloc: %d GB\n", mem.Alloc/1000/1000/1000) Using runtime.ReadMemStats shows that the program is using ~17GB (and verified by using htop), but pprof only reports about ~2.3GB. ![]() Problem is, when I run the program, the Go runtime allocates ~17GB of memory while a matrix only takes up ~2-3GB. To do this I've set up a pipeline of 3 goroutines where the first reads in files, the second calculates the correlation matrix and the last stores the result to disk. I have a Go program that calculates large correlation matrices in memory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |