duaner1634 2017-06-20 16:08
浏览 60

Web服务器使用的实际内存。 内存未释放到操作系统

I push a bunch of requests through the web server, and according to Htop / activity monitor on my mac, Virt is 530G, Res is 247Mb.

The memory doesn't seem to be being released to the OS. I tried adding the following for force memory to be returned to OS as a test to no avail:

func freeMem() {
    tick := time.Tick(time.Second * 10)

    for range tick {
        debug.FreeOSMemory()
    }
}

and at the top of main, calling go freeMem(), but this seems to have no effect.

So I tried checking garbage collector is working properly and visualising with dave cheney's gcvis https://github.com/davecheney/gcvis:

Looks like gcvis shows things are working fine and dandy, but htop & activity monitor seem to be v high memory usage.

Do I have anything to worry about? One thing I did notice in gcvis, is that whilst gc.heapinuse goes down to acceptable levels, scvg.released and scvg.sys seem to remain high.

gcvis output

htop & activity monitor

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?