This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Re: Patch: memory leak in java/lang/natClass.cc


>>>>> "Michael" == Michael Koch <konqueror@gmx.de> writes:

Michael> I found another memory leak in java/lang/natClass.cc in 
Michael> _Jv_PrepareConstantTimeTables. The attached patch moves two abortion 
Michael> checks before the allocation of memory.
Michael> Okay to commit to trunk ?

I don't think this change is correct.  With this patch,
klass->ancestors will remain NULL.  However that indicates that the
tables haven't been prepared at all.

What do you think about that?

There is still a leak here.  This memory should be properly freed when
the class is finalized.  One way would be to add code to
Class.finalize.  However, I'd really like to get rid of this method
entirely, if possible.  So another approach would be to arrange for
some of these fields to be allocated via the collector (and marked as
well, of course).

Tom


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