From: Naruto Nguyen <narutonguyen2018@gmail.com>
To: Harsh Jain <harshjain.prof@gmail.com>
Cc: Mulyadi Santosa <mulyadi.santosa@gmail.com>,
kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: How to detect slab memory leak
Date: Wed, 19 Dec 2018 18:58:16 +0700 [thread overview]
Message-ID: <CANpxKHFRzV9btx29=L70yC+8a1qJwbyyP55BHQvUoQOZQgRhng@mail.gmail.com> (raw)
In-Reply-To: <CAFXBA=mDab0qDLzYiv15EYwSsVayJhGsZ5cNwUiYYavAO3VQCw@mail.gmail.com>
Hi Harsh and Mulyadi,
Thanks a lot for your reply.
Just another question, in the slabtop output, I see that we have
kmalloc-64 and kmalloc-96 cache, when these caches increase their
size, is it calculated in the "cache" of the "free" command or in
"used". Is it reclaimable? and count in SReclaimable or SUnreclaim of
cat /proc/meminfo? I know some cache like dentry or inode cache will
be calculated in "cache" of free command output and SReclaimable of
cat /proc/meminfo and can be freed by "echo 3 >
/proc/sys/vm/drop_caches" but not sure if it the same situation for
kmalloc-64 and kmalloc-96 cache.
Thanks again,
Brs,
Bao
On Tue, 18 Dec 2018 at 15:31, Harsh Jain <harshjain.prof@gmail.com> wrote:
>
> You can try kernel config option "CONFIG_DEBUG_KMEMLEAK".
>
>
> https://www.kernel.org/doc/html/v4.10/dev-tools/kmemleak.html
>
> On Tue, Dec 18, 2018 at 1:14 PM Mulyadi Santosa
> <mulyadi.santosa@gmail.com> wrote:
> >
> >
> >
> > On Sun, Dec 16, 2018 at 1:25 PM Naruto Nguyen <narutonguyen2018@gmail.com> wrote:
> >>
> >> Hi everyone,
> >>
> >> When using slabtop to display the cache size growing, I see that
> >> kmalloc-1024 and kmalloc-256 are increasing about 200MB after 1 hour.
> >> Is there any way to detect which kernel components cause this slab
> >> increase?
> >>
> >> Thanks a lot,
> >> Brs,
> >> Naruto
> >>
> >
> > Hello Naruto
> >
> > I think you can do it by instrumenting call to kmalloc(). These days, eBPF is the hot stuff to try for this matter. See if it fits yours too.
> >
> > regards,
> >
> > Mulyadi
> >
> >>
> >> _______________________________________________
> >> Kernelnewbies mailing list
> >> Kernelnewbies@kernelnewbies.org
> >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
> >
> >
> > --
> > regards,
> >
> > Mulyadi Santosa
> > Freelance Linux trainer and consultant
> >
> > blog: the-hydra.blogspot.com
> > training: mulyaditraining.blogspot.com
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2018-12-19 11:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-16 6:23 How to detect slab memory leak Naruto Nguyen
2018-12-18 7:42 ` Mulyadi Santosa
2018-12-18 8:31 ` Harsh Jain
2018-12-19 11:58 ` Naruto Nguyen [this message]
2018-12-21 7:32 ` Mulyadi Santosa
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='CANpxKHFRzV9btx29=L70yC+8a1qJwbyyP55BHQvUoQOZQgRhng@mail.gmail.com' \
--to=narutonguyen2018@gmail.com \
--cc=harshjain.prof@gmail.com \
--cc=kernelnewbies@kernelnewbies.org \
--cc=mulyadi.santosa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).