Memory leak

matsunaga matsunaga_kazuhisa at yahoo.co.jp
Mon Mar 10 10:48:22 EST 2003


Hi


> On Mon, 2003-03-10 at 14:53, Thomas Gleixner wrote:
> > On Monday 10 March 2003 00:10, matsunaga wrote:
> > > Yes, I use JFFS2.
> > > If you mount a device with a file on JFFS2, a dirent node and a dnode are
> > > alloced. But upper layer does not issue, jffs2_clear_inode for an inode of
> > > the dnode during unmount. You can see it just by free command if my
> > > implementation is not wrong.
> > on umount put_super is called
> > void jffs2_put_super (struct super_block *sb)
> > {
> > SNIP
> > jffs2_free_ino_caches(c);
> > jffs2_free_raw_node_refs(c);
> > vfree(c->blocks);
> > SNIP
> > }
> > So everything is freed there. Are you looking at the first line of output from 
> > free (Mem:) ? Have a look at the second line (-/+ buffers/cache). If this is 
> > worrying you too, then send output of free before mount and after umount.
> 
> If you can rmmod jffs2 without a BUG() then it's freed everything in its
> own slabs, although it is theoretically possible that it's leaked
> something kmalloc'd. Unlikely though.

It is correct that rmmod will resolve it, but my concern is a consistency of resource and memory saving.
Dnode resource acuqired during mount seems not to be refereneced when you access to the file.
 
Best regards.

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/





More information about the linux-mtd mailing list