symbol tables never compacted
Bug #301993 reported by
Denis Koreshkov
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ikarus Scheme |
Fix Committed
|
Medium
|
Abdulaziz Ghuloum |
Bug Description
Once a symbol has been interned, it is never removed from its symbol table.
e.g.
(do ((i 0 (+ i 1))) (#f) (string->symbol (number->string i)))
never stops growing despite the fact nobody uses all those created symbols.
This may cause problems with applications using symbols to represent words ans strings.
It is surely possible to implement gc pass to get rid of symbols which are
1) not referenced by anyone except car of some symbol-table-bucket
2) have empty property-list and unique-string slots.
I am aware that the pass can actually be a slowdown to both gc and intern_string,
but on the other hand it is wrong allowing junk to pile up in a garbage-collected system.
Related branches
Changed in ikarus: | |
milestone: | none → 0.0.4 |
To post a comment you must log in.
On Nov 25, 2008, at 6:17 AM, Denis Koreshkov wrote:
> It is surely possible to implement gc pass to get rid of symbols
> which are
> 1) not referenced by anyone except car of some symbol-table-bucket
> 2) have empty property-list and unique-string slots.
3) do not have a value set
Yes. I did that before (in a previous incarnation of ikarus).
> I am aware that the pass can actually be a slowdown to both gc and
> intern_string,
No, I don't think it would cause any slowdown. It just adds a little
complexity to the gc.
> but on the other hand it is wrong allowing junk to pile up in a
> garbage-collected system.
Agreed of course. The only problem is that I won't be able to get
around to doing this for some time due to pressure (school and all).