Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Aug 20, 2024
1 parent c375814 commit e9b2b21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/enclave/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ func main() {
// temporary code to help identify OOM
go func() {
for {
heap, err := os.Create(fmt.Sprintf("heap_%s.pprof", time.Now().Format(time.RFC3339)))
heap, err := os.Create(fmt.Sprintf("/heap_%d.pprof", time.Now().UnixMilli()))
if err != nil {
panic(fmt.Errorf("could not open CPU profile: %w", err))
panic(fmt.Errorf("could not open heap profile: %w", err))
}
err = pprof.WriteHeapProfile(heap)
if err != nil {
panic(fmt.Errorf("could not write CPU profile: %w", err))
}
stack, err := os.Create(fmt.Sprintf("stack_%s.pprof", time.Now().Format(time.RFC3339)))
stack, err := os.Create(fmt.Sprintf("/stack_%d.pprof", time.Now().UnixMilli()))
if err != nil {
panic(fmt.Errorf("could not open CPU profile: %w", err))
panic(fmt.Errorf("could not open stack profile: %w", err))
}
err = pprof.Lookup("goroutine").WriteTo(stack, 1)
if err != nil {
Expand Down

0 comments on commit e9b2b21

Please sign in to comment.