-
- // Setup any memory profiling requested by the user. This will snapshot
- // the heap at the end of every generation.
- if *memProfilePrefix != "" {
- memProFile, err := os.Create(*memProfilePrefix + "-gen" + strconv.Itoa(generation) + ".mprof")
- if err != nil {
- log.Fatal("ERROR: Unable to write heap profile to disk:", err)
- }
- pprof.WriteHeapProfile(memProFile)
- memProFile.Close()
- }