Kaleb KEITHLEY has uploaded this change for review. (
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1170254?usp=email )
Change subject: main: periodically poke malloc()/free() to release memory
......................................................................
main: periodically poke malloc()/free() to release memory
Try to improve the odds that freed memory will be released
to the operating system, potentially reducing VIRT and RES
sizes.
malloc_trim(3) is in glibc, and when compiling with tcmalloc
or jemalloc it effectively becomes a no-op.
For allocations above a certain size (128K default) malloc(3)
uses mmap, which should usually be released when freed. But
below that memory is allocated by the use of brk(2) to increase
the size of the program in memory. Freeing memory allocated with
brk(2) may or may not happen automatically. Calling malloc_trim(2)
may release memory when it isn't released after freeing it.
Change-Id: I543e320128db8f6382c462a1b52518a89a0bcfcb
Signed-off-by: Kaleb S. KEITHLEY <kkeithle(a)redhat.com>
---
M src/MainNFSD/nfs_init.c
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/54/1170254/1
--
To view, visit
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1170254?usp=email
To unsubscribe, or for help writing mail filters, visit
https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I543e320128db8f6382c462a1b52518a89a0bcfcb
Gerrit-Change-Number: 1170254
Gerrit-PatchSet: 1
Gerrit-Owner: Kaleb KEITHLEY <kaleb(a)redhat.com>
Gerrit-MessageType: newchange