* [Caml-list] Strange Behaviour with Hashtables and Marshalling
@ 2001-07-25 18:20 Amit Dubey
0 siblings, 0 replies; 2+ messages in thread
From: Amit Dubey @ 2001-07-25 18:20 UTC (permalink / raw)
To: caml-list
Hi Everyone,
I've recetly have two odd things happen to me in O'Caml, and I
was wondering if anyone else has come across the same behaviour --
(1) If I'm doing some processing, then I save a few relevant data
structures to disk with Marshal, terminate, then restart, reload
the data and then continue processing, I use significantly less memory than
if I process everything without stopping. I'd imagine with garbage
collection, this wouldn't be a problem, yet I have come across it with both
the x86 and sparc native code versions (haven't tried bytecodes or any
other platform). Forcing a GC collection doesn't seem to help.
(2) If I'm saving really really big hashtables, which are part of
an enumerated type that can also contain closures ie:
module MyHash = Hashtbl.Make(...)
type t = Table of float MyHash.t | Junk of foo | Func of (float -> float)
After marshalling and reloading an instance of Table(s), some elements
in the table have mysteriously changed. This isn't a problem if I change
the type of t to:
type t = Table of float MyHash.t | Junk of foo
Again, I think I noticed this on both the sparc and x86 versions.
I didn't find out exactly what was going on (deadlines!), but
I was just wondering if anyone might have ideas as to what the
problem might be.
Thanks,
Amit Dubey
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] Strange Behaviour with Hashtables and Marshalling
@ 2001-07-25 18:33 Damien Doligez
0 siblings, 0 replies; 2+ messages in thread
From: Damien Doligez @ 2001-07-25 18:33 UTC (permalink / raw)
To: caml-list
>From: Amit Dubey <adubey@hopper.math.uwaterloo.ca>
> (1) If I'm doing some processing, then I save a few relevant data
>structures to disk with Marshal, terminate, then restart, reload
>the data and then continue processing, I use significantly less memory than
>if I process everything without stopping. I'd imagine with garbage
>collection, this wouldn't be a problem,
It looks like you have a fragmentation problem. Try Gc.compact ().
-- Damien
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-07-25 18:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-25 18:20 [Caml-list] Strange Behaviour with Hashtables and Marshalling Amit Dubey
2001-07-25 18:33 Damien Doligez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox