Oz and Mozart Users Mailing List

Re: GC problem?


From: Christian Schulte (schulte@ps.uni-sb.de)
Date: Fri Aug 24 2001 - 10:34:55 CEST


That's definitely not a Mozart problem, it's your program that is at fault.
The problem is that the method add is not tail-recursive: the recursive call
to add comes before the call to next. That means the stack of the thread
executing the initial call to add will grow proportional to its argument.

The size of the stack will drop only after the next garbage collection (it
does indeed, I checked).

Let me also mention the Oz Panel, a tool that observes memory size, number
of threads, etc. So start the Panel, run your program (all within in the
OPI), and after you have run your program, invoke a GC manually (you can do
that from the Panel after you have selected Configure in the Options menu).

Christian

----- Original Message -----
From: "Robin Lee Powell" <rlpowell@digitalkingdom.org>
Newsgroups: mozart-oz.users
Sent: Thursday, August 23, 2001 10:04 PM
Subject: GC problem?

> So, I ran into what I thought was a GC problem, so I simplified the
> code. Please find it attached to this message (as a text/plain
> attachment, so it should be readable to everyone).
>
> During the creation of the objects and the addition running, the memory
> usage peakes at about 90MB resident. After the addition, it drops to
> about 50MB, which I can deal with.
>
> What I can't deal with is that after the local is left, and no
> references exist to the chain of objects that has been created, the
> memory usage doesn't drop.
>
> At all.
>
> Is this my code, or did I just find a bug in the GC?
>
> -Robin
>
> --
> http://www.digitalkingdom.org/~rlpowell/ BTW, I'm male, honest.
> le datni cu djica le nu zifre .iku'i .oi le so'e datni cu to'e te pilno
> je xlali -- RLP http://www.lojban.org/
>

-
Please send submissions to users@mozart-oz.org
and administriva mail to users-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.