[Bug libgcj/16134] Memory leak in String.getBytes()
hannes at helma dot at
gcc-bugzilla@gcc.gnu.org
Tue Jun 22 13:04:00 GMT 2004
------- Additional Comments From hannes at helma dot at 2004-06-22 13:01 -------
OK, I found what's going on.
The problem is in gnu.gcj.convert.UnicodeToBytesgetEncoder(String encoding)
SuSE 9.1 uses UTF-8 as standard, but the file.encoding System property is set to
"UTF-8" rather than the canonical "UTF8". Calling
UnicodeToBytesgetEncoder(String encoding) with a non-canonical encoding name
causes the lookup in the encoderCache to fail. A new Encoder instance is created
each time and the encoderCache is swamped with instances (at least that's what I
guess is happening).
The fix should be easy - just canonicalize() the encoding name before looking it
up in the cache (it is done afterwards anyway).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16134
More information about the Java-prs
mailing list