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.

Cyrill

-- 
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/0203c68d-9e27-4a4e-8bed-88d4db0a1d39n%40googlegroups.com.

Reply via email to