This is the mail archive of the java@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: Finding memory leaks


Hi,

Yes, your test case collects ram properly on my system. I have made
many such test cases. GCJ is great at collecting ram in all my test
cases. But, when I write/release a full app and get feedback about it
using hundreds of megs of ram, and experiencing this myself only when
it is compiled with gcj it becomes difficult to figure out the cause.

I profiled the app in java (borland profiler) and didn't find any
leaks. I included System.gc()'s at strategic points, but it doesn't
seem to have an affect.

I'd really like to know where the memory is going, but I dont know how
to figure this out. GC_PRINT_STATS just tells me about an ever growing
heap, but not why it is growing or what is on it.


Regards,
Rutger Ovidius


On Saturday, February 28, 2004, Andrew Haley wrote:

> Does a trivial app (concatenate a ton of strings, throw a way the
> result, loop) collect OK for you?  It does for me.

> public class gc
> {
>   static public void main (String[] s)
>   {
> 	for (int i=0; i<100000; i++)
> 	  {
> 		String zz = "          ";
> 		for (int j=0; j<20; j++)
> 		  zz += zz;
> 	  }
>   }
> }

> There is always a risk that because of conservative collection we're
> incorrectly marking a few objects, but that doesn't sound exactly like
> the problem you're having.

> I've been thinking about this.  What we really need is a mode that
> prints out every object found during the sweep in such a way that you
> can see how everything has been reached.

> Andrew.




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