[OpenAFS-devel] AFSD memory footprint

Nickolai Zeldovich kolya@MIT.EDU
Thu, 02 Aug 2001 15:12:12 -0400


>                                 Is there any reason that we don't
> 'free()' that memory before the last afs_syscall()?  I'm thinking that
> this could potentially free a few megabytes of RAM.  Or will it not
> matter since the virtual memory is already mapped into the process
> space?

In theory the allocator can give back that memory to the kernel,
either by munmap()'ing or by shrinking your break value if malloc
uses the heap (though in the heap case, you'd have to ensure no
subsequent outstanding allocations at the end of the heap.)

I'm not sure how many malloc implementations actually would return
the extra memory immediately, but it seems like we should free the
memory, to be correct if nothing else.

-- kolya