All of lore.kernel.org
 help / color / mirror / Atom feed
From: anish198519851985@gmail.com (anish kumar)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Memory leak with dev_add_pack()
Date: Sun, 23 Jan 2011 21:22:25 +0530	[thread overview]
Message-ID: <3C31A5729CF549748A7960F8DCB9AA45@your6c359a3bdc> (raw)
In-Reply-To: 20110123124909.GB2034@michaelblizek.twilightparadox.com

> Hi!
>
> On 11:40 Sun 23 Jan     , Spiro Trikaliotis wrote:
> ...
>> * On Sat, Jan 22, 2011 at 08:18:05AM +0100 Michael Blizek wrote:
> ...
>> > - Which user grows is /proc/slabinfo? (If this file is emply or does 
>> > not
>> >   exist, you may meed to recompile the kernel to use slab instead of
>> >   sl[b-z]b)
>>
>> Thank you for the pointer, it might help.
>>
>> The objects which have changed the most on a mildly loaded network are:
>>
>> 25000 buffer_head
>>  5000 dentry
>>  5000 ext3_inode_cache
>>  5000 size-64
>>
>> The number if the number of more active object after approx. 20h of
>> letting it run on the mildly loaded network.
>>
>> Note that the ext3_inode_cache might have grown because I was regularly
>> writing a new log file from slabinfo (slabinfo --once > slabinfo.`date
>> +...`)
>>
>> Thus, I would expect I am leaking buffer_head.
>
> The funny point is that buffer_head belongs to the filesystem subsystem. 
> What
> file systems are you using? Could it be that your code just triggers the
> memory leak, because data is logged to disk, e.g. to /var/log/kern.log ?
I did small experiment with your code.I removed all your logs which were 
getting
logged in kernel buffers(kern.log).With this change i checked the "meminfo" 
and found that
the memory leaking is almost same as compared to normal case(with no change 
in your code).

>
> I have tried your program on my virtual machine (2.6.28) and could see any
> leak, but maybe data is leaked very slowly...
i confirm that data is leaking very slowly (below is the output i got on my 
ubuntu machine
with removed logs from your code).

$date
Sun Jan 23 19:13:47 RET 2011

$ head -n5 /proc/meminfo
MemTotal:        1018172 kB
MemFree:          373708 kB
Buffers:           32232 kB
Cached:           296004 kB
SwapCached:            0 kB

$ date
Sun Jan 23 19:15:03 RET 2011

$ head -n5 /proc/meminfo
MemTotal:        1018172 kB
MemFree:          373584 kB
Buffers:           32248 kB
Cached:           296004 kB
SwapCached:            0 kB

With logs enabled in your code i can see marginal increase in leaking 
memory.
I can defintely see the memory leaking with your ko and will investigate 
further as to the reason.
Hopefully kmemleak will lead us somewhere.

>
> -Michi
> -- 
> programing a layer 3+4 network protocol for mesh networks
> see http://michaelblizek.twilightparadox.com
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies 

  reply	other threads:[~2011-01-23 15:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 20:54 Memory leak with dev_add_pack() Spiro Trikaliotis
2011-01-22  7:18 ` Michael Blizek
2011-01-23 10:40   ` Spiro Trikaliotis
2011-01-23 12:49     ` Michael Blizek
2011-01-23 15:52       ` anish kumar [this message]
2011-01-23 16:20         ` Michael Blizek
2011-01-23 17:29           ` anish kumar
2011-01-24 16:08             ` Michael Blizek
2011-01-25  3:12               ` anish singh
     [not found] ` <F272513BE9F24B28A764C7CA5982EDA4@your6c359a3bdc>
2011-01-23 10:45   ` Spiro Trikaliotis
2011-01-23 13:03 ` Daniel Baluta

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=3C31A5729CF549748A7960F8DCB9AA45@your6c359a3bdc \
    --to=anish198519851985@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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.