Re: Help about calculating total memory consumption during booting

From: PINTU KUMAR
Date: Mon Dec 30 2013 - 21:00:28 EST







>________________________________
> From: Stefan Beller <stefanbeller@xxxxxxxxxxxxxx>
>To: PINTU KUMAR <pintu_agarwal@xxxxxxxxx>; "linux-mm@xxxxxxxxx" <linux-mm@xxxxxxxxx>; "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>; "mgorman@xxxxxxx" <mgorman@xxxxxxx>
>Sent: Monday, 30 December 2013 1:55 AM
>Subject: Re: Help about calculating total memory consumption during booting
>
>
>On 29.12.2013 19:17, PINTU KUMAR wrote:
>> Hi,
>>
>> I need help in roughly calculating the total memory consumption in an embedded Linux system just after booting is finished.
>> I know, I can see the memory stats using "free" and "/proc/meminfo"
>>
>> But, I need the breakup of "Used" memory during bootup, for both kernel space and user application.
>>
>> Example, on my ARM machine with 128MB RAM, the free memory reported is roughly:
>> Total: 90MB
>> Used: 88MB
>> Free: 2MB
>> Buffer+Cached: (5+19)MB
>>
>> Now, my question is, how to find the breakup of this "Used" memory of "88MB".
>> This should include both kernel space allocation and user application allocation(including daemons).
>>
>
>http://www.linuxatemyram.com/ dont panic ;)
>
>How about htop, top or
>"valgrind --tool massif"
>
>



Thanks for the reply, I know about top, but top does not help much in arriving at the total memory consumption.


I need the physical memory usage breakup of each process during bootup, with a segregate of user and kernel allocation.

1) If I add up all "Pss" field in "proc/<PID>/smaps, do I get the total Used memory?
2) Is the Pss value includes the kernel side allocation as well?
3) What fields I should choose from /proc/meminfo" to correctly arrive at the "Used" memory in the system?
4) What about the memory allocation for kernel threads during booting? Why does its Pss/Rss value shows 0 always

I already tried adding up all "PSS" values in every PIDs, but still it does not match any where near to the total used memory in the system.

Please help.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/