Start learning Go. I can not understand why memory consumption is growing. Doesn't garbage collector work? The gorutines are executed and completed.

package main import ( "time" ) const kol = 5 func parsePage(c chan <-string, page string) { time.Sleep(100 * time.Millisecond) c <- "Fin" } func main() { c := make(chan string, kol) i := 0 for { for i := 0; i < kol; i++ { go parsePage(c, "exa") } for i := 0; i < kol; i++ { //fmt.Println(i, " ", <-c) <-c } i++ time.Sleep(2000 * time.Millisecond) } } 
  • How to measure? With expvar enabled, expvar memory grows only until the garbage collection expvar , after which it decreases and starts growing again, as expected. - Ainar-G
  • Measured by the Windows Task Manager 10x64. In the beginning there was 1 mb. After a couple of minutes already 2 mb and increased over time (left for 5 minutes). - Aleksandr
  • Start with reduced slips and with GOGC=10 , for example, or less. See how garbage collection works. And in general, the task manager is also a tool for assembling such information. Use the same expvar . - Ainar-G 5:02 pm
  • Thank you. Understood. - Aleksandr

0