<NotThatRPG>
Alfr: But if you don't catch the return value from that loop, shouldn't those symbols be garbage-collected?
<NotThatRPG>
They won't be reachable in any way
<Alfr>
NotThatRPG, that only matters if the loop terminates, but in the mean time it's accumulating all those into a list.
<NotThatRPG>
Sure, but what I was asking was: can uninterned symbols ever be GCed. I *think* the answer is yes, and I also think that INTERNED symbols can never be GCed.
<Alfr>
NotThatRPG, though I'd expect, that those generated by (loop (gensym)) should be cleaned up for you.
<NotThatRPG>
Put differently: are uninterned symbols like other CL data structures, garbage collectable when there are no pointers to them, or are they like interned symbols which are always reachable (barring deleting packages or other drastic surgery)
<Alfr>
NotThatRPG, you can UNINTERN them ... so, never while they are interned, sure.
<NotThatRPG>
I was wondering if there was something about *UN* interned symbols that could keep them from being garbage collected? (I mean something special that isn't true of other CL data)
tyson2 has joined #commonlisp
<Bike>
uninterned symbols can be GC'd.
<NotThatRPG>
I was looking at the output of ROOM for a program that does symbolic computing, and it had a lot of symbols listed, which surprised me
<Bike>
assuming the implementation is competent, of course. but there's nothing preventing it.
<Bike>
if you do make-symbol/gensym/etc and then drop the result, there's no way to recover it later. it's unreachable.
<NotThatRPG>
"3,146,059,248 bytes for 65,542,901 symbol objects"
<Alfr>
NotThatRPG, maybe some function still refers to them or by one's debug info? Likely implementation dependent.
<NotThatRPG>
in dynamic space
<Bike>
You're sure they're uninterned?
<Alfr>
NotThatRPG, that certainly are a lot.
aartaka has joined #commonlisp
<Bike>
they of course can't be GC'd if they're reachable in some other way, like any data as you said
<NotThatRPG>
Alfr: New symbols are created in the process of unification. Before unifying two expressions, one is "standardized" -- all its variables are given unique names. That makes a lot of symbols in general, but they should be ephemeral
mal1 is now known as lieven
<NotThatRPG>
After a full GC on SBCL, there are still a lot of symbols, which I had not expected: 3,083,444,784 bytes for 64,238,433 symbol objects
<NotThatRPG>
Using DO-ALL-SYMBOLS, I see only c. 41,500 interned symbols. So that does seem like a lot there.
<Alfr>
NotThatRPG, maybe the variables * ** *** are keeping things alive?
<Bike>
NotThatRPG: it might be worthwhile to track the lifetimes of these symbols using weak pointers. on sbcl, you can use sb-ext:search-roots to get an idea of what's keeping an object alive (if anything)
attila_lendvai has joined #commonlisp
<NotThatRPG>
Alfr: I don't think that's likely because these symbols are used pretty deep in the call tree.
<NotThatRPG>
Bike: So stash some weak pointers to these objects when my VARIABLE-GENSYM function makes them and then use search-roots to find out why they aren't getting gc'ed?
<Bike>
that's what i'm imagining, yeah.
<NotThatRPG>
That's a great idea, thanks!
<Bike>
i haven't actually used this facility so i can't help much with it - but i figured it might help to know it exists
puchacz has quit [Quit: Client closed]
random-nick has joined #commonlisp
aartaka has quit [Ping timeout: 248 seconds]
aartaka has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
amoroso has quit [Quit: Client closed]
<ober>
Shinmera: how did you avoid libposix/libosicat and other external linkages?
<Shinmera>
I just hard code the constants for the os combinations I care about.
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
<ober>
nice. thanks.
aartaka has quit [Ping timeout: 255 seconds]
<NotThatRPG>
Bike: Indeed it is. I am just getting a lisp image into the right state to try this out.
shka has quit [Ping timeout: 255 seconds]
morganw has joined #commonlisp
dlowe has quit [Ping timeout: 268 seconds]
anticomputer has quit [Quit: quit]
anticomputer has joined #commonlisp
tyson2` has joined #commonlisp
<masinter>
there is no need to use symbols if it doesn't work well with the GC. Use hash tables
morganw` has joined #commonlisp
attila_lendvai_ has joined #commonlisp
tyson2` has quit [Remote host closed the connection]
attila_lendvai_ has quit [Ping timeout: 248 seconds]
morganw has quit [*.net *.split]
attila_lendvai has quit [*.net *.split]
tyson2 has quit [*.net *.split]
son0p has quit [*.net *.split]
rgherdt_ has quit [Remote host closed the connection]
anticomputer has quit [Remote host closed the connection]
<NotThatRPG>
masinter: ?
anticomputer has joined #commonlisp
attila_lendvai has joined #commonlisp
<NotThatRPG>
masinter: was that for me? The symbols are used in symbolic programming (sort of like theorem-proving). In this case, symbols are used as variables in s-expressions for logical formulas. So I'm not sure what you mean by "use hash tables". (I will possibly replace the symbols with variable structures that have a slot for a name)
attila_lendvai has quit [Ping timeout: 252 seconds]
morganw` has quit [Remote host closed the connection]
karlosz has joined #commonlisp
random-nick has quit [Ping timeout: 255 seconds]
Posterdati has quit [Ping timeout: 260 seconds]
kevingal has quit [Ping timeout: 246 seconds]
karlosz has quit [Quit: karlosz]
phileasfogg has quit [Quit: "It's the only way, then they can all forget me. I got too big, Dorium, too noisy. Time to step back into the shadows."]
phileasfogg has joined #commonlisp
lxi has joined #commonlisp
inline__ has joined #commonlisp
Inline has quit [Ping timeout: 248 seconds]
<NotThatRPG>
Bike: Thanks for the suggestion -- I checked and I have almost 66 million uninterned symbols that are not getting GCed!