View Single Post
Posts: 1,100 | Thanked: 2,797 times | Joined on Apr 2011 @ Netherlands
#59
As I expressed my concern about possible memory use of a Qt program (Qalendar in this case) in the background, I decided to check that every once in a while (ps aux, (h)top etc).

Although it is hard to determine exact values (think complex shared memory), we should be able to see a global picture. The thing I constantly noticed is that the memory usage of qalendar dropped significantly soon.

Scenario:

- Killall qalendar at start of measurements
- Automatically run smem en ps_mem (two python memory reporting tools) every half an hour for a period of time while not using the device

smem report on qalendar:

Code:
           Swap      USS      PSS      RSS
22:58:04 160.0K    15.4M    16.6M    21.0M 
23:28:26 256.0K    15.2M    16.4M    20.9M 
23:58:47 352.0K    14.6M    16.0M    20.8M 
00:29:08   5.2M     4.6M     5.4M     9.2M 
00:59:29   5.3M     4.5M     5.2M     9.0M 
01:29:50   5.3M     4.5M     5.2M     9.0M 
02:00:10   5.3M     4.5M     5.2M     9.0M 
09:34:12   5.6M     5.3M     6.7M    11.3M
Info from smem on the meaning of the columns: the "proportional set size" (PSS) of a process is the count of pages it has in memory, where each page is divided by the number of processes sharing it. So if a process has 1000 pages all to itself, and 1000 shared with one other process, its PSS will be 1500. The unique set size (USS), instead, is a simple count of unshared pages. It is, for all practical purposes, the number of pages which will be returned to the system if the process is killed. The resident set size (RSS) is the portion of a process's memory that is held in RAM. The rest of the memory exists in swap or the filesystem

ps_mem report on qalendar:
Code:
          Private  +   Shared  =  RAM used
22:58:04  15.3 MiB +   1.3 MiB =  16.7 MiB
23:28:26  15.2 MiB +   1.3 MiB =  16.5 MiB
23:58:47  14.6 MiB +   1.5 MiB =  16.2 MiB  
00:29:08   4.6 MiB + 930.0 KiB =   5.5 MiB   
00:59:29   4.5 MiB + 911.0 KiB =   5.4 MiB 
01:29:50   4.5 MiB + 911.0 KiB =   5.4 MiB
02:00:10   4.5 MiB + 911.0 KiB =   5.4 MiB 
09:34:12   5.3 MiB +   1.5 MiB =   6.9 MiB
The last measurement is after bringing Qalendar to be foreground the next day. As I see qalendar partly beeing moved to swap (which explains less ram used), the total amount of memory used seem to have shrunk. Any viable explanations (some memory reclaim by OS?)? Well, it definitely took away some worries I had about it
 

The Following 6 Users Say Thank You to ade For This Useful Post: