[gclist] Garbage collection and XML
Bill Foote
Bill.Foote@eng.sun.com
Tue, 06 Mar 2001 14:56:44 +0100
"Richard A. O'Keefe" wrote:
>
> Really interesting results. What you have shown here, though,
> does not seem to be that DOM API is terribly bad for memory savings.
> Rather, it seems to show that DOM implementations should use shared
> strings/attributes.
>
> If you follow the letter of the DOM specification (the CORBA IDL, not the
> Java and Javascript bindings) that is not *allowed*.
>
> I think you may have overlooked one point I made, which is that the
> DOM flatly and unconditionally *requires* that strings be sequences of
> 16-bit characters. That's a factor of two overhead in space, even if
> a DOM implementation *were* to use shared strings.
How on Earth did they manage to word a normative requirement that does
that?
Surely, if I store strings UTF-8 encoded in an immutable string type, there's
no way for an application to tell I'm sharing strings behind the scenes. I
have trouble imagining wording that could place a testable normative requirement
like this on an API. I'm genuinely curious; what wording in the DOM spec says
this?
Confused,
Bill
--
Bill Foote bill.foote @ sun.com
Java TV Standards Engineer http://java.sun.com/products/javatv