On 06/28/2011 06:12 PM, Daisuke Nishimura wrote:
> On Tue, 28 Jun 2011 17:42:11 -0700
> Kevin Constantine<kevin.constant...@disneyanimation.com>  wrote:
>
>> On 06/28/2011 05:32 PM, Daisuke Nishimura wrote:
>>> Hi.
>>>
>>> On Tue, 28 Jun 2011 11:26:14 -0700
>>> Kevin Constantine<kevin.constant...@disneyanimation.com>   wrote:
>>>
>>>> Hey everyone-
>>>>
>>>> I'm not sure what to make of the memory.usage_in_bytes value.  There's a
>>>> cgroup that has no processes in it, but the memory.usage_in_bytes is set
>>>> to 4GB.
>>>>
>>>> [root@tera1132 coda]# cat cgroup.procs
>>>> [root@tera1132 coda]# cat tasks
>>>> [root@tera1132 coda]# cat memory.usage_in_bytes
>>>> 4670476288
>>>> [root@tera1132 coda]#
>>>>
>>>> Is this a bug, or am I mis-understanding the purpose of that attribute?
>>>>
>>> What does "cat memory.use_hierarchy" show ?
>>> If it shows "1"(iow, enabled), the usages of all cgroups under the directory
>>> are summed up and accounted as usage of the directory.
>>>
>>> Thanks,
>>> Daisuke Nishimura.
>>
>> memory.use_heirarchy is 0.  There aren't any cgroups below this one anyway.
>>
>> [root@tera1138 coda]# cat cgroup.procs
>> [root@tera1138 coda]# cat tasks
>> [root@tera1138 coda]# cat memory.use_hierarchy
>> 0
>> [root@tera1138 coda]# cat memory.usage_in_bytes
>> 3161718784
>> [root@tera1138 coda]#
>>
>> -kevin
> hmm, I see.
>
> Another possibility is that these usages are used by processes which were 
> running
> in the group before(and not in the group anymore, or have exited).
>
> You can use memory.move_charge_at_immigrate to move usage along with task 
> move.
> But note that it can only move usage of mmaped memory by the process(See
> Documentation/cgroups/memory.txt for details), and older kernel doesn't have 
> the feature.
>
> And, page-cache is not freed usually even if a process has exited. If you want
> to flush it, you need "echo 1>/proc/sys/vm/drop_caches".
>
> Thanks,
> Daisuke Nishimura.


It looks like it's the pagecache that was throwing me off.  "cache" from 
memory.stat is equivalent to the memory.usage_in_bytes value, and rss is 0.

[root@tera1133 coda]# cat cgroup.procs
[root@tera1133 coda]# cat memory.usage_in_bytes
2658271232
[root@tera1133 coda]# cat memory.use_hierarchy
0
[root@tera1133 coda]# cat memory.stat
cache 2658271232
rss 0
mapped_file 28672
pgpgin 376859956
pgpgout 376210964
swap 0
inactive_anon 0
active_anon 0
inactive_file 1245843456
active_file 1412427776
unevictable 0
hierarchical_memory_limit 6442450944
hierarchical_memsw_limit 9223372036854775807
total_cache 2658271232
total_rss 0
total_mapped_file 28672
total_pgpgin 376859956
total_pgpgout 376210964
total_swap 0
total_inactive_anon 0
total_active_anon 0
total_inactive_file 1245843456
total_active_file 1412427776
total_unevictable 0

I'll start using the values in memory.stat instead.

Thanks everyone.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to