Bug 285159 - Filelight has a huge memory leak
Summary: Filelight has a huge memory leak
Status: RESOLVED NOT A BUG
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-28 08:54 UTC by Gerhard
Modified: 2011-10-31 08:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard 2011-10-28 08:54:15 UTC
Version:           unspecified (using KDE 4.7.2) 
OS:                Linux

Filelight doesn't return the memory it allocates when it's closed. This becomes obvious if you read in a lot of data.

Reproducible: Always

Steps to Reproduce:
1. read in a lot of data into filelight, t.ex. the whole root file system
2. watch how much RAM is consumed
3. close filelight

Actual Results:  
most allocated RAM isn't freed

Expected Results:  
all RAM should be freed

Filelight Version is 1.10
Comment 1 Christoph Feck 2011-10-28 09:19:05 UTC
How do you check allocated memory of a process when the application has closed?
Comment 2 Gerhard 2011-10-28 15:19:50 UTC
It is the memory and swap display of ksysguard and the system monitor plasmoid of KDE. 
However, in the process list of ksysguard or top filelight consumes quite little memory, at least far less than is eaten up from the "global" memory display.
Comment 3 Christoph Feck 2011-10-28 15:34:02 UTC
That "global" memory is the disk cache maintained by the operating system.

To verify if there really is a memory leak, open a root Konsole, and type this composed command (you probably have to issue it multiple times, until its output becomes stable):

> sync && sync && echo 3 > /proc/sys/vm/drop_caches && free

The interesting field is the "used" field in the _second_ row (i.e. the usage after buffers/caches are subtracted), NOT in the "Mem:" row. This is the real memory used by all applications and the system.

Now run filelight, let it scan as long as you want, exit it, go back to the Konsole window, and check the new memory usage.

If the numbers are different, there is a memory leak somewhere (likely in the application launcher, i.e. plasma-desktop). You would have to compare the memory usage of individual processes to check which of them leaks.

Unless you still believe there is a leak, I am closing this. Reopen otherwise.

(Note: the "drop_caches" does not cause any data loss, but it causes disk caches to be freed, so that the system has to reload that data from disk until the caches are filled again. This means the system will be quite slow right after dropping the caches.)
Comment 4 Gerhard 2011-10-31 08:04:04 UTC
I see. Thanks for taking the time to explain this issue! 
Indeed, there's no leak.