You are not logged in.

#1 2014-06-22 10:10:54

nenesse
Member
Registered: 2011-11-19
Posts: 10
Website

[updatedb/mlocate] memory leak[solved]

Hello,
I have a memory leak with updatedb.
Do you have the same problems?
Is this a known bug?

Thanks.

┏━━━┫ root@pc14570 ~ ┣━━━━━━━━━━━━━━━━━━━━    
┗━┫ free -m ; updatedb ;free -m
             total       used       free     shared    buffers     cached
Mem:         15925        395      15529         47         19        146 
-/+ buffers/cache:        229      15695
Swap:            0          0          0   
             total       used       free     shared    buffers     cached
Mem:         15925        566      15358         47        114        156 
-/+ buffers/cache:        295      15629
Swap:            0          0          0   
┏━━━┫ root@pc14570 ~ ┣━━━━━━━━━━━━━━━━━━━━              
┗━┫locate -S
Database /var/lib/mlocate/mlocate.db:
	49063 directories
	443871 files
	29061235 bytes in file names
	10911126 bytes used to store database
┏━━━┫ root@pc14570 ~ ┣━━━━━━━━━━━━━━━━━━━━              
┗━┫

Last edited by nenesse (2014-06-22 15:43:43)

Offline

#2 2014-06-22 15:28:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,260

Re: [updatedb/mlocate] memory leak[solved]

You are misinterpreting things.
Regardless of whether a program looses track of memory it has been allocated by the kernel and therefore fails to properly free it, the kernel does not forget.  When the application exits, all of the memory it had allocated will be released by the kernel.
What you are seeing is an increase the amount of stuff that is cached.  Unused memory is wasted memory.  Updatedb happens to read a bunch of files.  The kernel takes some of that unused memory and keeps some of the interesting stuff in the files that were read in memory so that if you turn around and ask for that information again, it is at hand.  If you need the memory for something else, the kernel will release the stuff in that cached space and allocate it as needed.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-06-22 15:43:10

nenesse
Member
Registered: 2011-11-19
Posts: 10
Website

Re: [updatedb/mlocate] memory leak[solved]

Thank you for that precision.

Offline

Board footer

Powered by FluxBB