Forum: Cfengine Help
Subject: Re: Very high memory consumption of cf-execd
Author: matter
Link to topic: https://cfengine.com/forum/read.php?3,17337,17515#msg-17515

There is a facility for debugging malloc on AIX. I enabled the malloc debugging 
on cf-serverd (non-threaded) on the policy host and I got some output. I am 
having a difficult time making sense out of it. Here is a excerpt from the 
output (the top hitters):

HashControls
SetNewScope
NewScope
malloc
################################
278376 bytes leaked in 14 Blocks
################################
method_getentry
open_attr_file_14_2
common_open
malloc
################################
262144 bytes leaked in 4 Blocks
################################
HashVariables
SetNewScope
NewScope
malloc
################################
198840 bytes leaked in 10 Blocks
################################
ExpandList
ExpandPrivateRval
strdup_5_3
malloc
################################
165433 bytes leaked in 7901 Blocks
################################
AppendRlist
CopyRvalItem
strdup_5_3
malloc
################################
154245 bytes leaked in 6428 Blocks
################################
NewAssoc
CopyRvalItem
AppendRlist
malloc
ExpandPrivateRval
ExpandList
AppendRlist
malloc
################################
126304 bytes leaked in 7894 Blocks
################################
main
GenericInitialize
NewScope
malloc
################################
119304 bytes leaked in 6 Blocks
################################
init_map_rules
add_rule
irs_lcl_ho
malloc
################################
64080 bytes leaked in 4874 Blocks
################################
AddVariableHash
NewAssoc
strdup_5_3
malloc
################################
61470 bytes leaked in 2073 Blocks
################################
GenericInitialize
SetNewScope
NewScope
malloc
################################
39768 bytes leaked in 2 Blocks
################################
yylex
yy_create_buffer
yyalloc
malloc
################################
32868 bytes leaked in 4 Blocks
################################
NewScalar
AddVariableHash
NewAssoc
malloc

It is a little misleading as it is a dump of what currently is in memory that 
has not been freed. Most of it could be normal runtime operation at that moment 
in time. It does somewhat validate some of my suspicions that it is scope 
related as the environment for a connecting client may not have been fully 
freed. I poked around in the code, and it seems that it should be freeing the 
memory, which leads me back to nowhere. Hopefully someone with more CFengine-fu 
can interpret this better.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to