Re: Unexpected Memory Allocation
For those interested: I traced it down to boxing double-floats. I
discovered, for example, that sometimes inlined functions still boxed
floats when the float was being returned through (values...). Changing
some of the inlines to macros actually reduced boxing. There's still some
needless boxing I'm trying to get rid of though...
(On a sample run of, say, 10,000 calculations, most of the time is being
spent in the garbage collector.)
owner-lisp-hug@xanalys.com wrote on 03/15/2004 08:09:44 PM:
> I'm trying to track down some unexpected memory allocations. I
> spotted the
> allocations with "time" (eg, "Allocation = 68192 bytes standard/121220
> bytes conses") and followed up using "trace" with the :
> allocation option.
> (The code is compiled with full optimization, but I've also checked
> results without optimizations enabled.)
>
> I have a function x which calls a function y. According to trace, y uses
> 16 bytes; but x, which returns right after calling y, allocates over
> 17900! The only other thing that x does directly is to call "etypecase".
> This all leaves me wondering if the cause is something I don't directly
> see--ie, a side-effect of some Lisp feature.
>
> Some very general questions then:
>
> * Would special vars allocate memory when they're "overloaded" in a
> function?
> * Would funcall allocate memory?
> * Would multiple (return) values allocate memory?
> * Would typecase allocate memory?
>
> I've been looking at the disassembled code, and I see calls to anonymous
> functions every now and then but of course I don't know what
> they do--thus
> the very broad strokes as I try to track down the cause(s).
>
> Thanks!
>