profiler: where are the samples??

Denys Duchier Denys.Duchier at ps.uni-sb.de
Tue Oct 23 14:00:52 CEST 2001


pvr at info.ucl.ac.be (Peter Van Roy) writes:

> The thread leak is pretty bad.  E.g., the following
> exhausts virtual memory rather quickly:
>
>    declare
>    S P={NewPort S}
>    thread {ForAll S proc {$ X} skip end} end
>    proc {Loop} {Send P foo} {Loop} end
>    {Loop}

Here you are leaking memory because S is declared global, so that you
keep a reference to it.

Leif will surely correct if I am wrong, but I don't _think_ the above
actually leaks memory in the thread because the implicit closure is
just a tail call to ForAll and the reference to S won't last beyond
that call... In fact that's very easy to try out and I just did and
the memory usage is fairly stable.

Cheers,

-- 
Dr. Denys Duchier			Denys.Duchier at ps.uni-sb.de
Forschungsbereich Programmiersysteme	(Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45	http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50			Phone: +49 681 302 5618
66041 Saarbruecken, Germany		Fax:   +49 681 302 5615
-
Please send submissions to hackers at mozart-oz.org
and administriva mail to hackers-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-hackers mailing list