All of lore.kernel.org
 help / color / mirror / Atom feed
From: dong  <bauers@126.com>
To: dong <bauers@126.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>,
	Michal Hocko <mhocko@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	bugzilla-daemon@bugzilla.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re:Re:Re: Re: [Bug 201699] New: kmemleak in memcg_create_kmem_cache
Date: Wed, 21 Nov 2018 16:46:48 +0800 (CST)	[thread overview]
Message-ID: <375ca28a.7433.16735734d98.Coremail.bauers@126.com> (raw)
In-Reply-To: <6185b79c.9161.1672bd49ed1.Coremail.bauers@126.com>

[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]

Sorry, I found when I ran `echo 3 >  /proc/sys/vm/drop_caches`, the leak memory was released very slowly. 

The `Page Cache` of the opened log file is the reason to cause leak. Because the `struct page` contains 
`struct mem_cgroup *mem_cgroup` which has a large chunk of memory. Thanks everyone for helping me to
solve the problem.


The last question: If I alloc many small pages and not free them, will I exhaust the memory ( because every page contains `mem_cgroup` )?




At 2018-11-19 19:56:53, "dong" <bauers@126.com> wrote:

Sorry, there's a leak indeed. The memory was leaking all the time and I tried to run command `echo 3 > /proc/sys/vm/drop_caches`, it didn't help.

But when I delete the log files which was created by the failed systemd service, the leak(cached) memory was released. 
I suspect the leak is relevant to the inode objects.





At 2018-11-19 16:30:45, "Vladimir Davydov" <vdavydov.dev@gmail.com> wrote:
>On Sun, Nov 18, 2018 at 08:44:14AM +0800, dong wrote:
>> First of all,I can see memory leak when I run ‘free -g’ command.
>
>This doesn't mean there's a leak. The kernel may postpone freeing memory
>until there's memory pressure. In particular cgroup objects are not
>released until there are objects allocated from the corresponding kmem
>caches. Those objects may be inodes or dentries, which are freed lazily.
>Looks like restarting a service causes recreation of a memory cgroup and
>hence piling up dead cgroups. Try to drop caches.
>
>>So I enabled kmemleak. I got the messages above. When I run ‘cat
>>/sys/kernel/debug/kmemleak’, nothing came up. Instead, the ‘dmesg’
>>command show me the leak messages. So the messages is not the leak
>>reason?How can I detect the real memory leak?Thanks!





 

[-- Attachment #2: Type: text/html, Size: 2914 bytes --]

  reply	other threads:[~2018-11-21  8:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-201699-27@https.bugzilla.kernel.org/>
2018-11-15 21:06 ` [Bug 201699] New: kmemleak in memcg_create_kmem_cache Andrew Morton
2018-11-16  2:23   ` dong
2018-11-16  3:04     ` dong
2018-11-16  3:37       ` dong
2018-11-16 17:50   ` Vladimir Davydov
2018-11-18  0:44     ` dong
2018-11-19  8:30       ` Vladimir Davydov
2018-11-19 10:24         ` Michal Hocko
2018-11-19 11:56         ` dong
2018-11-21  8:46           ` dong [this message]
2018-11-21  8:56             ` Vladimir Davydov
2018-11-21  9:06               ` dong
2018-11-21  9:10             ` Michal Hocko
2018-11-21  9:22               ` dong
2018-11-21  9:36                 ` 段熊春
2018-11-21 16:27                   ` Michal Hocko
2018-11-22  2:19                     ` 段熊春
2018-11-22  7:32                       ` Michal Hocko
2018-11-22  2:56                     ` 段熊春
2018-11-22  7:34                       ` Michal Hocko
2018-11-22  8:21                         ` 段熊春
2018-11-23  6:54                         ` 段熊春
2018-11-21  8:52           ` Re: " Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=375ca28a.7433.16735734d98.Coremail.bauers@126.com \
    --to=bauers@126.com \
    --cc=akpm@linux-foundation.org \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vdavydov.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.