Answer the question
In order to leave comments, you need to log in
Leaks in the Go standard library?
The situation is almost identical to that described in this ticket: stackoverflow.com/questions/21080642/memory-leak-i...
I take the simplest code from the documentation:
package main
import (
"net/http"
)
func main() {
http.ListenAndServe(":8080", nil)
}
while [ true ]
do
ab -n 1000 -c 100 http://127.0.0.1:8080/
sleep 1
end
Answer the question
In order to leave comments, you need to log in
The first thing to check is the version of Go. early versions, even those that start with 1, are not particularly stable and suffer from leaks.
Secondly, you need to understand that keep-alive leaves connections open for some time and this affects the amount of memory consumed (however, when the activity becomes less, the memory will also be cleared over time). To make sure that it does not flow, it is worth disabling keep-alive for the test.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question