[JDEV] js_user problem/leak

Glenn MacGregor gtm at oracom.com
Wed Apr 3 09:13:35 CST 2002


Jer,

Looking into the jid_user problem further, it seems that another major
problem is the js_user function, which gets called twice for each message
(sending user and receiving user).  This function allocates off the jid
parameter pool (id), which is the session pool.

The main problem is that there in no concept of a local variable, if you
need a jid it has to be taken from a pool, in this case the only pool is the
session pool.  An analogous set of functions which I can pass a pool in may
be an option. Create a local pool to use for all local variables.

Problem Code:

This mallocs off of id's pool (session pool) twice, once for the jid_user
call and once for the jid_new.  Guaranteed to fail after a while.
uid = jid_new(id->p, jid_full(jid_user(id)));



Any suggestions on a clean fix would be great.  I don't want to implement a
cache system like jid_full because we are still wasting memory in my
opinion.

    Thanks

            Glenn




More information about the JDev mailing list