GCJ 3.3 LEAKS Throwable & Derived Classes
David Daney
ddaney@avtrex.com
Sat Nov 19 17:22:00 GMT 2005
Craig A. Vanderborgh wrote:
> David Daney wrote:
>>> Craig A. Vanderborgh wrote:
>>>>> Hello:
>>>>>> We have just uncovered a really horrible problem with GCJ 3.3, on
>>> multiple platforms (x86 linux, arm-wince-pe, ARM/linux).
>>>>>> Instances of Throwable, and classes derived from it are leaked by
>>> garbage collection, in the following way. The GC heap size is
>>> unaffected, but the process virtual size/RSS reflects the leakage.
>>> Here is a sample program that demonstrates the problem:
>>>>>> class Catcher {
>>> public static void main(String [] args) {
>>> System.out.println("now in main");
>>>>>> while (true) {
>>> Exception foo = new Exception();
>>> }
>>> }
>>> }
>>>>>>> Most likely PR 12475
>>>> The fix was applied to the 3.3 branch on 2004年06月22日 18:21 by bryce.
>>>> If you are using 3.3 you could probably safely upgrade to 3.3.6 which
>> would include the patch.
>>>> David Daney
>>> THANK YOU very much for this reply. I need to ask you a follow-up
> though I will try to find the patch in the mail-trail..
>> In rough terms, what was affected by this patch, i.e. in what realm does
> this problem exist? Is it a compiler problem, a GC problem, or a libgcj
> problem. Please describe what needs to happen, because I'm going to
> have to update our sources for all of our 3 platforms.
>
First of all you need to look at the PR in the gcc bugzilla system:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12475
It explains fairly well what the problem is.
Second, In theory you would be able to see the patch there also. But
the patch viewer seems broken at the moment. You can also find the
patch in the e-mail archives here:
http://gcc.gnu.org/ml/java-patches/2003-q4/msg00006.html
Also I would leave the java@ group CCed so that others can add any
additional relevant information.
This patch fixes a memory leak that occurs whenever a stack trace is
generated (i.e. whenever a Throwable is created).
David Daney
David Daney
More information about the Java
mailing list