This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: memory leaks and java ...
"Ranjit Mathew" <rmathew4lists at hotmail dot com> writes:
> But in this case you are supposed to use "-mthreads" while
> linking in your program.
Right -- we're tricking the EH code into *thinking* that mingwm10 is
linked in, when in fact it is not. This convinces the EH that it
should allocate a different setjmp() buffer for each thread, believing
that mingwm10.dll will deallocate it.
Since mingwm10.dll is NOT present (we're not using -mthreads), we leak
about 24 bytes of memory per thread created. Somehow that doesn't
bother me, especially since a conservative garbage collector is likely
to leak more than that.
Recap:
-mthreads causes two things to happen:
1. CRT_MT defined ==> EH allocates different buffer for each thread
2. mingwm10.dll is linked in
We want (1) without (2), which is why I include the hack yet do NOT
put -mthreads in libgcj.spec.
- a