Golang:使用net / http分配的堆中的常量增加(内存泄漏),[关闭]

I have used golang for building an application api gateway using golang reverse proxy, But i could able to see a gradual memory increase by time and i tried to profile, here is the graph in few hour time after starting. Is there anything wrong in this or is it expected. All the allocations are happening from go inbuilt packages and negroni mux.

enter image description here

Number of go routins

As a matter of course, monitor your applications so that you know what drives usage (number of current requests, etc), and then correlate that with resource usage (CPU, memory, number of goroutines that currently exist, etc). You should have a cause and effect model of your application resource usage and monitor for significant deviations. In summary, take a systematic approach to measuring and monitoring resource usage.

Package runtime

import "runtime"

func NumGoroutine

func NumGoroutine() int

NumGoroutine returns the number of goroutines that currently exist.

For example, monitor and correlate the number of goroutines that currently exist. The number of goroutines should oscillate around a steady state based on key application drivers, like the number of current requests.

If you are not terminating goroutines properly in your program then they become inactive orphans. Orphan goroutines retain memory, a goroutine memory leak. You should see a steady increase in memory usage over time.

What is your goroutine model for your application? What are the goroutine statistics for your application? Do they correlate with memory. Do they correlate with increasing time?