This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: free() does not physically trim/reclaim memory


Hi, Florian:

On 09/02/2016 04:44 AM, Florian Weimer wrote:
On 09/01/2016 08:24 PM, shuxin yang wrote:
    In my application, I need to call mmap() a block right after BSS in
order to prevent heap from growing.

You cannot rely that this has any observable effect. Why do you need to do this?

Our application embeds luajit. Due to some limitations, luajit allocates object under 2G; on x86-64 platform, it is done by calling mmap() with flag MAP_32BIT and then cutting a block out of it. We need to preserve the space (BSS-end, 2G] for luajit. That is why we need to mmap() a tiny block right after BSS right before the main() function of the application
is entered.

Thanks
Shuxin

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]