Thank you for the tips, Nikodemus
To recap, I have an SBCL 1.0.42 process that is allocating about 2 million generic and unsigned-64 vectors of length
100, for about 2GB of mystery allocation. I have no idea what they are.
Following your tips, I looked through room.lisp for more undocumented functions that could be of use in probing the memory usage.
I managed to lobotomize my SBCL process so much trying to wipe the root object responsible for all my uncollectable vectors
(like deleting the info database) that I can't define any crawlers that use SB-VM:MAP-ALLOCATED-OBJECTS.
I also found that I have to be pretty careful using SB-VM:MAP-ALLOCATED-OBJECTS because it suspends GC and then
consing can crash SBCL.
Using (SB-VM::INSTANCE-USAGE :DYNAMIC), it seems that I have about 500K hash tables and 500K spinlocks and 500K
MYSQL-DATABASE objects. That's a number sort of close to the 2.5M unexplained vectors that also exist.
I never make spinlocks, just mutexes. Spinlocks are apparently deprecated after 1.0.42, so this might all be some quirk
or misuse of an outdated SBCL. CLSQL just uses SB-THREAD:MAKE-MUTEX
It's evident that something weird happened with threading and open databases, and I don't know where the uncollectable root is.
I'd be inclined to guess that a bunch of threads died, and didn't release some spinlocks,
which are someone pinning down some objects against GC. Is this a silly hypothesis?
For future reference, if this happens again, is the following a complete enumeration of roots where a mass of un-GC'able objects might reside:
1. conservative roots in the stack
2. user toplevel variables including *,**,etc, and functions.
3. another active thread (none, if no other threads)
4. objects referenced in a closure
5. sb-c::*info-environment* - can point to functions that are in deleted packages.
6. NOT global vars in PCL/CLOS because CLOS doesn't store pointers to instances
7. ??? Something weird with terminated threads not releasing locks …. the mechanics of which I don't get.
I realize that these are vague questions, so I can't expect precise answers, but if any blatant misconceptions jump out,
please let me know.
Thanks,
John Klein