Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#37 More memory leaks

Errors
open
nobody
5
2011-02-20
2011-02-20
Juha Lindström
No

The following code leaks about 77 bytes per loop (7664 kB after 100000 loops).

import clips
t = clips.BuildTemplate("foo", "")
while True:
f = t.BuildFact()
f.Assert()
f.Retract()

The following similar code does not leak:

import clips
while True:
f = clips.Assert("(foo)")
f.Retract()

Workaround:
If #define USE_NONASSERT_CLIPSGCLOCK is commented out in clipsmodule.h the memory is not leaked.

Apparently the problem is related to the hashtables used to track unasserted facts.

Discussion

  • The reported memory leak occurs with pyclips 1.0.7.348.