* Event.channel memory leak?
@ 2010-03-01 8:04 Satoshi Ogasawara
2010-03-01 20:34 ` [Caml-list] " ygrek
0 siblings, 1 reply; 3+ messages in thread
From: Satoshi Ogasawara @ 2010-03-01 8:04 UTC (permalink / raw)
To: caml-list
Hello,
I have found a strange memory behavior with Event module. Following code
works well.
----
open Event
let ct () =
let c = new_channel () in
ignore (Thread.create (fun () -> sync (send c 1)) ());
let i = sync (receive c) in
()
let _ =
let rec loop () =
ct ();
Thread.delay 0.01;
Gc.full_major ();
loop ()
in
loop ()
----
But, the next code makes increasing of memory use rapidly in my environment.
(version 3.11.2 on MacOS X leopard)
----
open Event
let ct c =
ignore (Thread.create (fun () -> sync (send c 1)) ());
let i = sync (receive c) in
()
let _ =
let c = new_channel () in
let rec loop () =
ct c;
flush stdout;
Thread.delay 0.01;
Gc.full_major ();
loop ()
in
loop ()
----
I have read inside of Event module source code, but could not detect what data
remains in the memory.
Is this behavior not strange? And How can I avoid the memory behavior?
---
satoshi ogasawara
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-02 4:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-01 8:04 Event.channel memory leak? Satoshi Ogasawara
2010-03-01 20:34 ` [Caml-list] " ygrek
2010-03-02 4:40 ` Satoshi Ogasawara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox