This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/16134] Memory leak in String.getBytes()
- From: "hannes at helma dot at" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jun 2004 13:02:03 -0000
- Subject: [Bug libgcj/16134] Memory leak in String.getBytes()
- References: <20040622101536.16134.hannes@helma.at>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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