We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
大佬,我看了这篇帖子 https://github.com/helios741/myblog/tree/new/learn_go/src/2021/08/go_feak_memory_lark 当我也想复现这个问题的时候出现了奇怪的情况, 内存一直不下来。。。
go版本:1.17.8 环境centos7 执行代码如下
package main import ( "fmt" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" "net/http" _ "net/http/pprof" "time" ) func allocate(s int) { a := make([]byte, s*1024*1024) for i := 0; i < len(a); i += 4096 { a[i] = 'x' } fmt.Printf("alloc%c %d\n", a[0], s) a = nil } func main() { allocate(100) allocate(200) allocate(500) go func() { // Expose the registered metrics via HTTP. http.Handle("/metrics", promhttp.HandlerFor( prometheus.DefaultGatherer, promhttp.HandlerOpts{ // Opt into OpenMetrics to support exemplars. EnableOpenMetrics: true, }, )) err := http.ListenAndServe(":8166", nil) if err != nil { log.Errorf("ListenAndServe: %+v", err) } }() time.Sleep(300 * time.Second) }
希望大佬可以解答下
The text was updated successfully, but these errors were encountered:
No branches or pull requests
大佬,我看了这篇帖子 https://github.com/helios741/myblog/tree/new/learn_go/src/2021/08/go_feak_memory_lark 当我也想复现这个问题的时候出现了奇怪的情况,
内存一直不下来。。。
go版本:1.17.8 环境centos7
执行代码如下
希望大佬可以解答下
The text was updated successfully, but these errors were encountered: