This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: memory leak in java/lang/natClass.cc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Mittwoch, 2. Juli 2003 05:54 schrieb Tom Tromey:
> >>>>> "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).
You're right. After sending this mail I found more "possible" memory
leaks. GCing the data allocated by this method is surely a solution.
I dont know enough about this stuff yet to say more. I need to look
deeper into it.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/AmUUWSOgCCdjSDsRAj2PAJ4ogSvE2a+i7PdNozRsAMYx833d7QCbB21C
YEdO6E5fay7X+tfR0QJ1QpE=
=iLCC
-----END PGP SIGNATURE-----