Hi,

I have noticed on my macbook pro that HeapInUse is always slightly above 
NextGC when the garbage collection occurs.  

According to mstats.go, the "garbage collector's goal is to keep HeapAlloc 
less than NextGC" and also  according to mstats.go, "HeapInUse minus 
HeapAlloc estimates the amount of memory that has been dedicated to 
particular size classes, but is not currently being used" so it makes 
sense   that HeapInUse rises above NextGC, and also that HeapIdle gets 
smaller as we get closer to NextGC. 

However, on my windows machine, as shown in this attached video, the 
garbage collections are occuring well below the NextGC level.  When the 
number of garabge collections changes from 4 to 5, the number of 
Allocations is well below the nextGC level.
https://youtube.com/shorts/jf6DoEQSnMk?feature=share

 On both the Mac and Windows machine, the nextGC level is the same. 

Question: Why is the garbage collection happening much sooner on the 
Windows than the Mac? 




-- 
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 on the web visit 
https://groups.google.com/d/msgid/golang-nuts/eec4d7e3-8c07-401e-999d-be0331e6e47en%40googlegroups.com.

Reply via email to