[elephant-devel] get-instances-by-value and get-instances-by-class
Ian Eslick
eslick at media.mit.edu
Fri Mar 5 15:39:55 UTC 2010
Hi Lukas,
How are you defining 'memory not released'? Is this a measure of the Lisp heap or the OS footprint?
As I recall, when allocating space in the heap for new objects, SBCL will periodically ask the OS for more heap memory. Even if the objects are garbage collected later, the allocated memory will remain (SBCL never releases heap memory back to the OS even if it isn't using most of it). It also asks for new heap space in increasingly large chunks much like a hash table.
The objects loaded into memory are stored in a weak hash table, and unless there's a bug in a recent SBCL, if you don't reference them elsewhere they should be garbage collected. You can use (gc) to make sure the GC has run and cleaned everything out and (room) to see how much memory is allocated for what kinds of objects.
It's possible that some of this memory is the shared memory allocated by BDB - but that can is upper-bounded in the my-config.sexp file and should be static.
Ian
On Mar 5, 2010, at 5:12 AM, Lukas Gießmann wrote:
> Hi list,
>
> in our application which uses elephant 1.0 with sbcl 1.0.29.11.debian on ubuntu we have a memory leak.
> After a lot of debugging I am sure to have found the responsible function. It seems that elephant:get-instances-by-value does not release the needed memory after the operation is done.
> I also have some debug-examples with this and other elephant functions and the needed memory:
>
> ---------------------
> (dotimes (i 1000000)
> (elephant:get-instances-by-value 'd::TopicIdentificationC 'd::uri "goethe"))
> ;--> memory that is not released after operation 29.0 MB
>
>
> (dotimes (i 1000000)
> (elephant:get-instance-by-value 'd::TopicIdentificationC 'd::uri "goethe"))
> ;--> memory that is not released after operation 0.1 MB
>
>
> (dotimes (i 1000000)
> (elephant:get-instances-by-class 'd::TopicIdentificationC))
> ;--> memory that is not released after operation 58.9 MB
> ---------------------
>
> Is there any function or any method to relaese the memory after a call of elephant:get-instances-by-value or elephant:get-instances-by-class. Maybe there is any other work-around?
>
>
> Thanks in advance
>
> Lukas
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20100305/2329867a/attachment.html>
More information about the elephant-devel
mailing list