Take a look on this post:
https://medium.com/samsara-engineering/running-go-on-low-memory-devices-536e1ca2fe8f

and function https://golang.org/pkg/runtime/debug/#FreeOSMemory
to reduce RSS of the process.

HTH,
Eduard

среда, 13 сентября 2017 г., 0:18:50 UTC+3 пользователь Ganesh Sangle 
написал:
>
> We have written a server in golang, and the requirement is that this 
> server should be as responsive and the process should never be swapped out.
> To enable this we added:
> err = syscall.Mlockall(syscall.MCL_CURRENT | syscall.MCL_FUTURE)
>
> The resulting behavior seems that top shows RES memory always increasing, 
> despite the fact that golangs garbage collector is releasing memory, seen 
> by using
> GODEBUG=gctrace=1 when starting the process:
>
>
> scvg-1: 10 MB released
> scvg-1: inuse: 13, idle: 10, sys: 24, released: 10, consumed: 13 (MB)
>
> Is there anyother way to make sure go process does not have its pages 
> swapped out ? (because the syscall does not seem to play well)
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to