I have a long-living application with frequent memory allocation-deallocation. Will any malloc
implementation return freed memory back to the system?
What is, in this respect, the behavior of:
- ptmalloc 1, 2 (glibc default) or 3
- dlmalloc
- tcmalloc (google threaded malloc)
- solaris 10-11 default malloc and mtmalloc
- FreeBSD 8 default malloc (jemalloc)
- Hoard malloc?
Update
If I have an application whose memory consumption can be very different in daytime and nighttime (e.g.), can I force any of malloc
's to return freed memory to the system?
Without such return freed memory will be swapped out and in many times, but such memory contains only garbage.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…