[ofa-general] Re: virtual memory usage on long lived apps

Dotan Barak dotanb at dev.mellanox.co.il
Tue Aug 7 08:09:40 PDT 2007


Steve Wise wrote:
>
>
> Roland Dreier wrote:
>>  > Running this server with clients repeatedly connecting,  running
>>  > rpings, and disconnecting, I notice that the virtual memory consumed
>>  > by the process is ever increasing.  The shared/and reserved values
>>  > don't increase, but the virtual does.  IE:  If you watch this process
>>  > via 'top' you'll see the VIRT value increasing steadily over
>>  > time/connections, and the RES/SHR values stay steady.  I've seen it
>>  > over 1GB of virtual memory used!
>>
>>  > Q: Have you seen this before?  Its like the OS never reuses mappings
>>  > that were setup for memory registrations.  Is that normal? Or should
>>  > the virtual size shown in 'top' be reduced whenever a buffer is
>>  > unregistered and freed?  There's a definite possibility the code is
>>  > leaking memory, but I'm wondering if this is perhaps a normal anomaly
>>  > with mapping memory in linux...
>>
>> I've not really tested an app like that, but I would expect that
>> freeing the memory should prevent your virtual space from growing.  I
>> would recheck your code and maybe add some tracing to make sure that
>> everything really does get freed -- or try the libibverbs valgrind
>> support ;)
>>
>
> I'll instrument the code and see if I can find the leak...
>
> What is valgrind (sounds painful :) ?
>
Valgrind is a freeware tool to detect many memory bugs (including buffer 
overrun/underrun/uninitialized and memory leaks).
It can be found in: http://www.valgrind.org/

Dotan



More information about the general mailing list