Skip to content

cmd/pprof: Ability to attribute memory usage to different instances of structs #50829

@aditighag

Description

@aditighag

I believe the pprof tooling can provide more information to help debug certain memory leak issues. Here is a (simplified) pseudo code to explain what additional information I'm looking for -

type Foo struct {
   c Cache 
}
type Bar struct {
   c Cache
}
s1 Foo
s2 Bar

type (c *Cache) Populate { -----> results in memory leak for s1 but not s2
   
}

Go tool proof (invoked with either inuse_space or inuse_objects would show that memory usage is increasing in the type (c *Cache) Populate, but it would be helpful if the tooling could attribute the memory usage to the different instances - s1 vs s2? While you can argue different design based the pseudo code, the feature request is relevant more generally.

Edit : I think this falls under the "feature request" category, but I'm unable to update the labels.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions