how to decrease the HeapIdle of Memory to free memory to Linux?

469 views
Skip to first unread message

Chou Yan

unread,
Jun 23, 2019, 10:59:06 PM6/23/19
to golang-nuts
My server have 100G memory. 
I limit my server 60G by cgroups.
But my app process use the momory more and more !
even more than 50G.
my prof:
# HeapIdle = 27377164288
# HeapInuse = 21910396928
The Cgroup will kill the process when  it use more than 60G
But golang runtime gc will not release the memory to the os. 
It's bad.

The Go garbage collector occasionally makes requests to the OS to release unused memory. The OS may decide to not release the memory because the system has plenty to spare, other some other reason .

How should this be solved?

Chou Yan

unread,
Jun 23, 2019, 11:00:51 PM6/23/19
to golang-nuts
some of gc logs:
gc 8639 @331692.423s 6%: 60+2541+2.3 ms clock, 1928+112357/40484/0+75 ms cpu, 22264->22299->4575 MB, 23164 MB goal, 64 P
gc 8640 @331719.932s 6%: 21+2580+1.5 ms clock, 673+106151/41127/0+48 ms cpu, 21976->22064->4769 MB, 22878 MB goal, 64 P
gc 8641 @331759.750s 6%: 31+2671+1.6 ms clock, 1019+115220/42609/0+54 ms cpu, 22904->22985->4785 MB, 23848 MB goal, 64 P
gc 8642 @331805.499s 6%: 86+2647+2.0 ms clock, 2771+106447/42162/0+65 ms cpu, 22976->23081->4678 MB, 23926 MB goal, 64 P
scvg2211: 0 MB released
scvg2211: inuse: 23445, idle: 23386, sys: 46832, released: 20705, consumed: 26126 (MB)
gc 8643 @331847.230s 6%: 43+2588+1.3 ms clock, 1399+112616/41295/0+44 ms cpu, 22463->22514->4605 MB, 23391 MB goal, 64 P
gc 8644 @331880.496s 6%: 31+2528+4.0 ms clock, 1001+113331/40209/0+128 ms cpu, 22127->22159->4613 MB, 23025 MB goal, 64 P
gc 8645 @331912.342s 6%: 35+2544+0.67 ms clock, 1145+109977/40616/0+21 ms cpu, 22151->22215->4685 MB, 23069 MB goal, 64 P
scvg2212: 81 MB released
scvg2212: inuse: 25495, idle: 21334, sys: 46830, released: 20773, consumed: 26056 (MB)
gc 8646 @331959.029s 6%: 35+2602+9.3 ms clock, 1136+109565/40585/0+297 ms cpu, 22495->22569->4643 MB, 23425 MB goal, 64 P



在 2019年6月24日星期一 UTC+8上午10:59:06,Chou Yan写道:
Message has been deleted

Chou Yan

unread,
Jun 23, 2019, 11:42:28 PM6/23/19
to golang-nuts
I use 'debug.FreeOsMemory'. But it is not the certain.


在 2019年6月24日星期一 UTC+8上午10:59:06,Chou Yan写道:
My server have 100G memory. 
Reply all
Reply to author
Forward
0 new messages