On Sat, Aug 23, 2025 at 5:09 PM Cyrill Troxler <cyrilltrox...@gmail.com> wrote: > > I noticed that simply importing certain modules can substantially increase > observed RSS even though nothing is visibly being allocated on the heap when > looking at pprof. For example, take the following program: > > ``` > package main > > import ( > "time" > ) > > func main() { > time.Sleep(time.Hour) > } > ``` > > Running this with go 1.24.6 and running it shows an RSS of 1688 KB (using ps). > > ``` > VSZ RSS > 1225172 1688 > ``` > > Now as an example, I just add the following import: `_ > "google.golang.org/grpc"` > > The RSS of the otherwise same program looks like this: > > ``` > VSZ RSS > 1646164 9896 > ``` > > First off, what exactly is causing this rather big increase in RSS here? Is > there any way to reduce this and if not, what is the best way to find such > heavy dependencies? > > I have used https://github.com/Zxilly/go-size-analyzer with some success but > this just looks at the binary size and is not very granular, e.g. I have no > way of knowing what exactly inside of the grpc module is causing this.
I didn't double check, but this could be a version of https://go.dev/issue/62024. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUF7Xx%2BjwK8ibD8tx-uji3wyVrXLGCER4eWtbmUsHAsWg%40mail.gmail.com.