Bug 1653250

Summary: memory-leak in crypt xlator (glusterfs client)
Product: [Community] GlusterFS Reporter: evangelos <vpolakis>
Component: encryption-xlatorAssignee: bugs <bugs>
Status: CLOSED CANTFIX QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.1CC: atumball, bugs, pasik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-27 16:19:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description evangelos 2018-11-26 11:27:55 UTC
Description of problem:
memory-leak in crypt xlator (glusterfs client)

Version-Release number of selected component (if applicable):
3.4

How reproducible:
create/delete large amounts of files

Steps to Reproduce:
1.
2.
3.

Actual results:
I created ~70K files and memory (RSS) started up from 435208 to 1663336 then rm and leave only 10K in the dir but RSS remained.

Expected results:
RSS should decrease after file deletion.

Additional info:
From the client statedumps I see that inode cache is released 
[encryption/crypt.oam_enc-crypt - usage-type gf_crypt_mt_inode memusage]
size=9293896
num_allocs=11279
max_size=64594184
max_num_allocs=78391
total_allocs=78560

but local allocations seem still present...

after deletion:
[encryption/crypt.oam_enc-crypt - usage-type gf_crypt_mt_local memusage]
size=547946008
num_allocs=678151
max_size=547946008
max_num_allocs=678151
total_allocs=678151

As i have seen in crypt xlator GF_CALLOC allocates memory from gf_crypt_mt_local pool.
local = GF_CALLOC (sizeof (*local), 1, gf_crypt_mt_local);

but in FRAME_DESTROY only mem_put(local) is called thus gf_common_mt_mem_pool is released which results of errors like 0-mem-pool: mem-pool ptr is NULL from glusterfs client.

Comment 1 Amar Tumballi 2019-05-27 16:19:29 UTC
with latest glusterfs builds, crypt xlator is no more loaded in graph, and is present in codebase.