memory usage and performance during schema modifications in samba4

Kamen Mazdrashki kamenim at
Sun Jul 4 07:53:06 MDT 2010

Hi Andrew,

On Sun, Jul 4, 2010 at 16:16, Andrew Bartlett <abartlet at> wrote:
> Do you have any idea where the ldb_msg objects are coming from?

It seems most of those object are coming from lib/ldb/common/ldb_msg.c
There are few functions that that take only 'struct ldb_context*' and
'stuct ldb_msg *' params,
which functions makes copies of ldb_msg internally or as a function result.

We should refactor those function IMO, so that all of them to take a
TALLOC_CTX to make
copies in. This way callers will be able to decide how exactly they
want memory to be handled
(and thus what the lifetime of memory to be)

I was planning to take over this task and propose a patch to solve the issue.
One thing I am afraid though is that ldb.h interface should be changed
as prototype
for ldb_msg_canonicalize and ldb_msg_diff may should be changed to
accept TALLOC_CTX.

Kamen Mazdrashki

More information about the samba-technical mailing list