From: Matthew Smillie Date: 2005-11-09T19:04:49+09:00 Subject: Re: Question about symbols On Nov 9, 2005, at 8:32, Robert Klemme wrote: >> Symbols are never garbage-collected, so you should not use them for >> situations where you could have an unbounded number of unique >> symbol values. > > That's why I recommended to use them with a limited set of values > only. > > Hope that makes things a bit clearer. I wonder if I could trouble the list a bit further on this one: I've got a collection of newswire articles, and I was thinking of using symbols to represent the words in each. I'd likely only ever be using a half-dozen articles at any one time, but I'd be using on the order of tens of thousands of articles over the course of the program. My hunch is that to avoid stuffing memory full of unused symbols, I should deal with each subset of articles in a forked process - I'm assuming that since threads run in the interpreter, they'll share the same symbol ids as the parent. This raises a couple of quick questions: firstly, how big is a "limited set", in a hand-waving, give or take an order-of-magnitude sort of estimate? Secondly, I note that the FAQ says that fork "is slow". Am I right to think that's simply the overhead of starting up the thread, and then things run smoothly thereafter, or is there some other penalty of which I'm not aware? thanks in advance & all enlightenment appreciated. matthew smillie.