runtime: CGo thread stacks stay in physical memory #71150
Labels
BugReport
Issues describing a possible bug in the Go implementation.
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Go version
go1.23.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
After the program pauses on the
select
call, RSS is497MB
for 150 OS threads. I see many segments of size3132KB
in thepmap
output - my uninformed guess is that these are thread stacks but it's unclear why they are still in physical memory.What did you expect to see?
RSS to fall much lower for the process - low enough just to support the Go runtime. This is a toy example but I'm seeing the same behaviour slowly "leak" memory for a real long-lived Go process that uses CGo.
The text was updated successfully, but these errors were encountered: