From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29963 invoked by alias); 22 Jun 2004 13:02:07 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 29920 invoked by uid 48); 22 Jun 2004 13:02:04 -0000 Date: Tue, 22 Jun 2004 13:04:00 -0000 Message-ID: <20040622130204.29919.qmail@sourceware.org> From: "hannes at helma dot at" To: java-prs@gcc.gnu.org In-Reply-To: <20040622101536.16134.hannes@helma.at> References: <20040622101536.16134.hannes@helma.at> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libgcj/16134] Memory leak in String.getBytes() X-Bugzilla-Reason: CC X-SW-Source: 2004-q2/txt/msg00239.txt.bz2 List-Id: ------- 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