This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Detecting memory leaks
- From: Hans Boehm <Hans dot Boehm at hp dot com>
- To: Jari Korva <jpkorva at iki dot fi>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 22 Sep 2004 20:52:34 -0700 (PDT)
- Subject: Re: Detecting memory leaks
- References: <Pine.GSO.4.58.0409221325210.8763@paju.oulu.fi>
A good first step is probably to determine whether the GC heap or the C
heap is growing. Setting the GC_PRINT_STATS and/or GC_DUMP_REGULARLY
environment variables should tell you that. (The latter produces lots of
output on large GC heaps.)
Hans
On Wed, 22 Sep 2004, Jari Korva wrote:
> Hi,
>
> are there any easy to use tools for finding gcj memory leaks, especially
> on ARM/XScale? For example the following code seems to leak on
> armv5l (gcj 3.4.0) and armv5b (gcj 3.4.2), but not on x86 (gcj 3.4.0):
>
> import java.net.*;
>
> public class MemLeakTest
> {
> public static void main(String args[])
> {
> for(;;)
> {
> try {
>
> URL url = new URL("http://princess.willab.fi:8111/");
> URLConnection conn = url.openConnection();
> System.out.println(conn.getContentType());
> conn.getInputStream().close();
>
> } catch(Exception e) {
> e.printStackTrace();
> }
> }
>
> }
> }
>
> Cheers,
> Jari
>
> --
> - Jari Korva -
>