This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/16134] Memory leak in String.getBytes()


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]