Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Memory management under OCAML
@ 1999-08-30 17:54 David McClain
  1999-08-31 20:00 ` Ching-Tsun Chou
  0 siblings, 1 reply; 2+ messages in thread
From: David McClain @ 1999-08-30 17:54 UTC (permalink / raw)
  To: caml-list

I am trying to understand the behavior of the interactive OCAML system. If I
repeatedly perform the following line:

    let x = Array.create 1000000 0.0;;

then each subsequent execution should shadow the previous ones making them
unreachable. Yet the GC never collects the old bindings, even after I
manually perform Gc.full_major() or Gc.compact().  Why is this?

In another vein, whenever I start OCAML in interactive mode on WinNT 4.0 it
grabs about 10 MBytes (give or take some). Yet when I compile my own code in
native code OCAMLOPT, my programs typically grab about 100 MBytes or so,
even before any overt memory allocations occur. Why is this? Should I even
be concerned about it? and is there a mechanism to preallocate a fixed
amount of heap for the runtime images I create?

D. McClain
Sr. Scientist
Raytheon Systems Co.
Tucson, AZ





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Memory management under OCAML
  1999-08-30 17:54 Memory management under OCAML David McClain
@ 1999-08-31 20:00 ` Ching-Tsun Chou
  0 siblings, 0 replies; 2+ messages in thread
From: Ching-Tsun Chou @ 1999-08-31 20:00 UTC (permalink / raw)
  To: dmcclain; +Cc: caml-list


   I am trying to understand the behavior of the interactive OCAML system. If I
   repeatedly perform the following line:

       let x = Array.create 1000000 0.0;;

   then each subsequent execution should shadow the previous ones making them
   unreachable. Yet the GC never collects the old bindings, even after I
   manually perform Gc.full_major() or Gc.compact().  Why is this?

Some time ago I observed the same thing and asked the same question.
To see the answer, go to the archive of Caml mailing list and search
for the thread "What exactly can be GC'ed?"

- Ching Tsun

=====================================================================
  Ching-Tsun Chou                   E-mail: ctchou@mipos2.intel.com  
  Intel Corporation                 Tel: (408) 765-5468              
  3600 Juliette Lane, SC12-401      Fax: (408) 653-7933              
  Santa Clara, CA 95052, U.S.A.     Sec: (408) 653-8849              
=====================================================================




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-01  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-30 17:54 Memory management under OCAML David McClain
1999-08-31 20:00 ` Ching-Tsun Chou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox