Bug 822378 - Memory leak in stripe in readv
Summary: Memory leak in stripe in readv
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: stripe
Version: 3.2.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: shishir gowda
QA Contact: shylesh
URL:
Whiteboard:
Depends On:
Blocks: 817967
TreeView+ depends on / blocked
 
Reported: 2012-05-17 08:19 UTC by Alexander Bersenev
Modified: 2013-12-09 01:31 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-24 17:44:03 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Alexander Bersenev 2012-05-17 08:19:51 UTC
Description of problem:
Memory leak in stripe in stripe_readv_fstat_cbk when this condition is true:
 if ((local->replies[i].op_ret <
      local->replies[i].requested_size) &&
      (local->stbuf_size > (local->offset + op_ret))) {

When iobuf is created it has reference count = 1.
After iobref_add (local->iobref, iobuf); reference count becomes 2.
After iobref_unref(local->iobref); it becomes 1 and never becomes 0.
So iobuf never deletes and this causes a memory leak.

Version-Release number of selected component (if applicable):
3.2.5 and git latest

How reproducible:
Always

Steps to Reproduce:
1. Make a files on bricks that makes this condition true
2. Read them and look on memory consumption. Outpu from top:
4618 root      20   0 1721m 1.5g 1868 S  0.0 16.2   5:41.77 glusterfs

I don't know if a condition can be true in usual environment, but when is true the memory leaks.
  
Actual results:
Memory leaks.

Expected results:
Memory doesn't leak.

Additional info:
See my proposed patch on review board: http://review.gluster.com/#change,3340

Comment 1 Anand Avati 2012-05-17 22:01:00 UTC
CHANGE: http://review.gluster.com/3340 (Fixed a memory leak in stripe translator.) merged in master by Anand Avati (avati)

Comment 2 Amar Tumballi 2012-05-31 17:08:13 UTC
tried with glusterfs-3.3.0 and no more leaks were found. Made sure that 'stripe_readv_fstat_cbk() is called by adding a gf_log() in that function for verification.


Note You need to log in before you can comment on or make changes to this bug.