Failed to enlarge memory
Hi there,
I don't normally concern myself with garbage collection and memory
allocation as I have no need for it in my day-to-day code However, Ive
recently been working on a bit of code where I'm running into
problems: Lispworks becomes unresponsive, and I need to force it
close.
My code has a list of 1000 objects, each of which has three vectors of
length 150, 150 and 1000. I need to do pairwise comparisons of all the
objects in the list, and store a list of the pairs of objects and
dot-products over the vectors, as well as merged vectors. Whether this
is a lot to ask, I don't know, but I'd be a little surprised if it
was.
Either way: After about 300 items through my list Lispworks becomes
unresponsive the console fills with 'Failed to enlarge memory'
messages, and may eventually fail with a 'fail to allocate object of
size x'. Reading through the documentation, it is suggested to
relocate the image using '--relocate-image address. I tried doing
this, but find I still have the same problem (though I should add, I'm
not sure where I should relocate the image).
So I started reading up on Garbage Collection and Memory Allocation
and playing around with (room)
Generation 0: Total Size 30229K, Allocated 4599K, Free 25621K
Generation 1: Total Size 108852K, Allocated 107762K, Free 1061K
Generation 2: Total Size 1004292K, Allocated 1004090K, Free 91K
Generation 3: Total Size 1072031K, Allocated 1071834K, Free 172K
Total Size 2215744K, Allocated 2188286K, Free 26946K
Looking at room it strikes me that Generation 2 and Generation 3
simply fill up. Calls to hcl:cleandown make space in Generation 2, but
appear to do so by promoting objects to Generation 3, which just fills
up. When allocated memory starts getting over 2GB, Lispworks just
freezes. And as far as I can tell Generation3 shouldn't normally grow
that large?
Any thoughts on what's going on here? Is this a memory clash? My poor
understanding of Memory Allocation and Garbage collection? Clumsy
coding? Something else altogether?
Lispworks 6.0, Mac OS 10.5.8, 4GB of Ram.
Thanks,
Dan.
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html