utf8const memory leak?

Per Bothner bothner at cygnus.com
Thu Mar 5 13:02:52 PST 1998

> Looking at the code... the function passed to gc_malloc when creating
> a string is gcUtf8Const,

I think you misunderstand the code.  There are two internal string
representations (not counting C's char*):  A Utf8Const, and a String object.
Utf8Const objects are normally static, allocated when a class is
created.  They should never be created during normal execution.
A java.lang.String object can be created from a Utf8Const,
but that should only happen once total for each string literal, not
once per reference to the literal.  When normal Java code
creates a string, using Integer.toSring, or StringBuffer's toString,
there should be no utf*Const objects involved.

	--Per Bothner
Cygnus Solutions     bothner at cygnus.com     http://www.cygnus.com/~bothner

More information about the kaffe mailing list