[Bro] Returning local variables and garbage collection
robin at icir.org
Mon Jul 27 10:39:31 PDT 2009
On Fri, Jul 24, 2009 at 16:53 -0700, you wrote:
> Or, is the object the same and just internal refcnt are increased or
> decreased? If so, it shouldn't really make any difference as refcnt
> should be going to 0 after X finishes.
This is indeed what happens. Non-atomic objects are passed around as
references, with reference counts adjusted as necessary.
> However, I'm experiencing and (almost linear) increasing memory
> consumption, and that's weird (bug?). Any idea?
Not sure right now, the code excerpts you showed look ok. One thing
to do is running with profiling.bro, that will let Bro generate a
file prof.log with various memory statistics. Feel free to send me
the output if it's too cryptic.
If that doesn't help, some leak checking/profiling could help
illuminating what's going on, see
P.S.: Are you creating any cyclic reference structures?
Robin Sommer * Phone +1 (510) 666-2886 * robin at icir.org
ICSI/LBNL * Fax +1 (510) 666-2956 * www.icir.org
More information about the Bro