|GE;(55.5.0+dev0-2025-04-28/"Gc$statA;@@+minor_words@@%float@@@{3../../stdlib/gc.mliTT@@"GcA@.promoted_words@@@@@~XeiXe@@B@+major_words@@@@@](,](@@@C@1minor_collections@@#int@@@*a+a@@)D@1major_collections@@@@@7d"&8d">@@6E@*heap_words@@@@@DhEh@@CF@+heap_chunks@@(@@@QkRk@@PG@*live_words@@5@@@^p_p@@]H@+live_blocks@@B@@@k@  l@  @@jI@*free_words@@O@@@xE  yE  @@wJ@+free_blocks@@\@@@H  H  @@K@,largest_free@@i@@@M s wM s @@L@)fragments@@v@@@R04R0D@@M@+compactions @@@@@WW @@N@.top_heap_words!@@@@@ZPTZPi@@O@*stack_size"@@@@@]]@@P@8forced_major_collections#@@@@@chlch@@Q@1live_stacks_words$@@@@@hh@@R@@@A@@@@@So@@@@@@A@'control%B;@@/minor_heap_size&@@@@@ڰzw{zw@@T@4major_heap_increment'@@@@@ݰ@@U@.space_overhead(@@@@@gkg@@V@'verbose)@@@@@!@@W@,max_overhead*@@@@@+,@@*X@+stack_limit+@@@@@89@@7Y@1allocation_policy,@@@@@EF.@@DZ@+window_size-@@)@@@RS@@Q[@2custom_major_ratio.@@6@@@_  `  @@^\@2custom_minor_ratio/@@C@@@l#B#Fm#B#_@@k]@5custom_minor_max_size0@@P@@@y%%z%%#@@x^@@@A@@@@@}yhh~&&@@@@|S@A@$stat1@$unit@@@@@"Gc$stat@@@@@,caml_gc_statAA @@@'_'_'_'@@_@@*quick_stat2@ @@@@@"Gc$stat@@@@@2caml_gc_quick_statAA@@@((()3@@`@@(counters3@>@@@@@#@@@@@@@@ @@@@!@@"@@$0caml_gc_countersAAL@@@***+>@@a@@+minor_words4@k@@@%@@'@@@&@@(3caml_gc_minor_wordsAA;caml_gc_minor_words_unboxed@@A++ ,,O@@b@@#get5@@@@)@@+"Gc'control@@@*@@,+caml_gc_getAA@@@"-p-p#--@%alert)--*--@5unsynchronized_access7--8--@@@@@ )GC parameters are a mutable global state.B--C--@@E--F--@@@@@@@@@@J--(@@Hc@@#set6@"Gc'control@@@-@@/@@@.@@0+caml_gc_setAAˠ@@@g..h/z/{@%alertn/+/.o/+/3@5unsynchronized_access|/+/4}/+/I@@@@@ )GC parameters are a mutable global state./J/O/J/x@@/J/N/J/y@@@@@@@@@@/+/+(@@d@@%minor7@@@@1@@3@@@2@@4-caml_gc_minorAA @@@'00'00@@e@@+major_slice8@@@@5@@7@@@6@@83caml_gc_major_sliceAA(@@@*11*11X@@f@@%major9@G@@@9@@;L@@@:@@<-caml_gc_majorAAC@@@222222@@g@@*full_major:@b@@@=@@?g@@@>@@@2caml_gc_full_majorAA^@@@53B3B53B3{@@h@@'compact;@}@@@A@@C@@@B@@D2caml_gc_compactionAAy@@@:4#4#:4#4Y@@i@@*print_stat<@&Stdlib+out_channel@@@E@@G@@@F@@H@/>440>44@@.j@@/allocated_bytes=@@@@I@@KG@@@J@@L@FB55GB55@@Ek@@.get_minor_free>@@@@M@@O4@@@N@@P3caml_get_minor_freeAAŠ@@@aG6a6abG6a6@@`l@@(finalise?@@!a@[C@Q@@S@@@R@@T@@X@@@V@@@U@@W@@Y@M7 7 M7 74@@m@@-finalise_last@@@ @@@\@@^@@@]@@_@@d@!a@gC@`@@b!@@@a@@c@@e@DDDD4@@n@@0finalise_releaseA@3@@@h@@j8@@@i@@k@FFFG @@o@@%alarmBC;@@@A@@@@@GGGG@@@@p@A@,create_alarmC@@X@@@l@@n]@@@m@@o@@q"Gc%alarm@@@p@@r@HsHsHsH@@q@@,delete_alarmD@"Gc%alarm@@@s@@u@@@t@@v@LLLL@@ r@@.eventlog_pauseE@@@@w@@y@@@x@@z@%MPMP&MrM@0ocaml.deprecated,MrMu-MrM@ !Use Runtime_events.pause instead.8MrM9MrM@@;MrM<MrM@@@@@@?MrMr@@=s@@/eventlog_resumeF@@@@{@@}@@@|@@~@UMMVMN@0ocaml.deprecated\MM]MM@ "Use Runtime_events.resume instead.hMMiMN@@kMMlMN@@@@@@oMM@@mt@@ӱ'MemprofD@!tGE;@@A@@@@@}QVQZ~QVQ`@@@@|u@A@1allocation_sourceHF;@@&NormalI@@QQQQ@@w@'MarshalJ@@QQQQ@@x@&CustomK@@QQQQ@@y@(Map_fileL@@QQQQ@@z@@@A@@@@@QQ@@A@v@A@;string_of_allocation_sourceM@"Gc'Memprof1allocation_source@@@@@&string@@@@@@QQQR@@{@@*allocationNG;@@)n_samplesO@@@@@R&R.R&R>@@}@$sizeP@@@@@R{RR{R@@~@&sourceQ@@"Gc'Memprof1allocation_source@@@RRRR@@@)callstackt@@&Stdlib(Printexc-raw_backtrace@@@ ɰ S'S/ S'SQ@@ @@@@@@@@@@RR SS@@@@|@A@'trackerH;%minor@ %major@ @B+alloc_minor@@@"Gc'Memprof*allocation@@@ @@ &optionL$I@ @@@ @@ >T\Tb?T\T@@=B@+alloc_major@@@"Gc'Memprof*allocation@@@ @@ = 1000000 , compaction is never triggered.@ [ This field is currently not available in OCaml 5: the field value is always !0!.@@@@@@@@@@@@M@@L3 FThe maximum size of the fiber stacks (in words). Default: 128M.@@@@@@@@@@@@H@@G3 1The policy used for allocating in the major heap.@ ] This field is currently not available in OCaml 5: the field value is always !0!.@ = Prior to OCaml 5.0, possible values were 0, 1 and 2.@90 was the next-fit policy@@ -1 was the first-fit policy (since OCaml 3.11)@@ ,2 was the best-fit policy (since OCaml 4.10)@@@@@@$3.11@@@@@@@f@@e3 The size of the window used by the major GC for smoothing out variations in its workload. This is an integer between 1 and 50.@@@@ f4.03 This field is currently not available in OCaml 5: the field value is always [0].@@@@@@@c@@b3 Target ratio of floating garbage to major heap size for out-of-heap memory held by custom values located in the major heap. The GC speed is adjusted to try to use this much memory for dead values that are not yet collected. Expressed as a percentage of major heap size. The default value keeps the out-of-heap floating garbage about the same size as the in-heap overhead. Note: this only applies to values allocated with 5caml_alloc_custom_mem ' (e.g. bigarrays). Default: 44.@@@@$4.08@@@@@@@f@@e3 CBound on floating garbage for out-of-heap memory held by custom values in the minor heap. A minor GC is triggered when this much memory is held by custom values located in the minor heap. Expressed as a percentage of minor heap size. Note: this only applies to values allocated with 5caml_alloc_custom_mem ( (e.g. bigarrays). Default: 100.@@@@$4.08@@@@@@@i@@h3 Maximum amount of out-of-heap memory for each custom value allocated in the minor heap. Custom values that hold more than this many bytes are allocated on the major heap. Note: this only applies to values allocated with 5caml_alloc_custom_mem 0 (e.g. bigarrays). Default: 70000 bytes.@@@@$4.08@@@@@@@@A@@on@@'Gc.stat3 EReturn the current values of the memory management counters in a $stat B record that represents the program's total memory stats. The +heap_chunks", +free_blocks", ,largest_free&, and *stack_size c metrics are currently not available in OCaml 5: their returned field values are therefore !0 3. This function causes a full major collection.@@@@@@@@@@@@@ @@@@-Gc.quick_stat3 TReturns a record with the current values of the memory management counters like $stat). Unlike $stat", *quick_stat S does not perform a full major collection, and hence, is much faster. However, *quick_stat reports the counters sampled at the last minor collection or at the end of the last major collection cycle (whichever is the latest). Hence, the memory stats returned by *quick_stat " are not instantaneously accurate.@@@@@@@@@@@@@.@@@@+Gc.counters3'Return *(minor_words, promoted_words, major_words) ^ for the current domain or potentially previous domains. This function is as fast as *quick_stat!.@@@@@@@@@@@@@I@@@@.Gc.minor_words3 Number of words allocated in the minor heap by this domain or potentially previous domains. This number is accurate in byte-code programs, but only an approximation in programs compiled to native code.@ 4 In native code this function does not allocate.@@@@$4.04@@@@@@@@^@@@@z&Gc.get3 4Return the current values of the GC parameters in a 'control( record.@) The 4major_heap_increment", ,max_overhead", 1allocation_policy*, and +window_size ^ fields are currently not available in OCaml 5: their returned field values are therefore !0!.@@@@@@@@@@@|r@@@@@@&Gc.set3%set r , changes the GC parameters according to the 'control( record !r;. The normal usage is: -Gc.set { (Gc.get()) with Gc.verbose = 0x00d }@) The 4major_heap_increment", ,max_overhead", 1allocation_policy*, and +window_size Y fields are currently not available in OCaml 5: setting them therefore has no effect.@@@@@@@@@@@wm@@@@@@(Gc.minor3;Trigger a minor collection.@@@@@@@@@@@@k@l@@@@^.Gc.major_slice3-major_slice n < Do a minor collection and a slice of major collection. !n S is the size of the slice: the GC will do enough work to free (on average) !n5 words of memory. If !n = 0, the GC will try to do enough work to ensure that the next automatic slice has no work to do. This function returns an unspecified integer (currently: 0).@@@@@@@@@@@@t@ u@@@@g(Gc.major3 DDo a minor collection and finish the current major collection cycle.@@@@@@@@@@@@h@i@@@@[3 Do a minor collection, finish the current major collection cycle, and perform a complete new cycle. This will collect all currently unreachable blocks.@@@@@@@@@@@@[@(\@@@@N$3 kPerform a full major collection and compact the heap. Note that heap compaction is a lengthy operation.@@@@@@@@@@@@N@6O@@@@A-Gc.print_stat3 Print the current values of the memory management counters (in human-readable form) of the total program into the channel argument.@@@@@@@@@@@@B@EC@@@@62Gc.allocated_bytes3 nReturn the number of bytes allocated by this domain and potentially a previous domain. It is returned as a %float $ to avoid overflow problems with #int4 on 32-bit machines.@@@@@@@@@@@@C@`D@@@@:1Gc.get_minor_free3 RReturn the current size of the free space inside the minor heap of this domain.@@@@$4.03@@@@@@@=@q>@@@@0`3,finalise f v+ registers !f as a finalisation function for !v%. !v: must be heap-allocated. !f5 will be called with !v 5 as argument at some point between the first time !v G becomes unreachable (including through weak pointers) and the time !v is collected by the GC. Several functions can be registered for the same value, or even several instances of the same function. Each instance will be called once (or never, if the program terminates before !v6 becomes unreachable).@  The GC will call the finalisation functions in the order of deallocation. When several values become unreachable at the same time (i.e. during the same GC cycle), the finalisation functions will be called in the reverse order of the corresponding calls to (finalise&. If (finalise is called in the same order as the values are allocated, that means each value is finalised before the values it depends upon. Of course, this becomes false if additional dependencies are introduced by assignments.@ In the presence of multiple OCaml threads it should be assumed that any particular finaliser may be executed in any of the threads.@ Anything reachable from the closure of finalisation functions is considered reachable, so the following code will not work as expected: 1 let v = ... in Gc.finalise (fun _ -> ...v...) v @@ & Instead you should make sure that !v B is not in the closure of the finalisation function by writing: 6 let f = fun x -> ... let v = ... in Gc.finalise f v @@( The !f function can use all features of OCaml, including assignments that make the value reachable again. It can also loop forever (in this case, the other finalisation functions will not be called during the execution of f, unless it calls 0finalise_release2). It can call (finalise$ on !v or other values to register other functions or even itself. It can raise an exception; in this case the exception will interrupt whatever the program was doing when the function was called.@$ (finalise, will raise 0Invalid_argument$ if !v  is not guaranteed to be heap-allocated. Some examples of values that are not heap-allocated are integers, constant constructors, booleans, the empty array, the empty list, the unit value. The exact list of what is heap-allocated or not is implementation-dependent. Some constant values can be heap-allocated but never deallocated during the lifetime of the program, for example a list of integer constants; this is also implementation-dependent. Note that values of types %float Q are sometimes allocated and sometimes not, so finalising them is unsafe, and (finalise4 will also raise 0Invalid_argument: for them. Values of type )'a Lazy.t- (for any "'a+) are like %float ^ in this respect, except that the compiler sometimes optimizes them in a way that prevents (finalise < from detecting them. In this case, it will not raise 0Invalid_argument %, but you should still avoid calling (finalise3 on lazy values.@; The results of calling +String.make@@", *Bytes.make@@", ,Bytes.create@@%, *Array.make@@&, and *Stdlib.ref@@ \ are guaranteed to be heap-allocated and non-constant except when the length argument is !0!.@@@@@@@@@@@@@n @q@@@@ Y3(same as hD@  except the value is not given as argument. So you can't use the given value for the computation of the finalisation function. The benefit is that the function is called after the value is unreachable for the last time instead of the first time. So contrary to nD@  the value will never be reachable again or used again. In particular every weak pointer and ephemeron that contained this value as key or data is unset before running the finalisation function. Moreover the finalisation functions attached with tD@ G are always called before the finalisation functions attached with sD@!.@@@@$4.04@@@@@@@%@&@@@@@ 3Gc.finalise_release3 !A finalisation function may call 0finalise_release x to tell the GC that it can launch the next finalisation function without waiting for the current one to return.@@@@@@@@@@@@@@@@@ #(Gc.alarm3 An alarm is a piece of data that calls a user function at the end of major GC cycle. The following functions are provided to create and delete alarms.@@@@@@@@@@@@@@A@@  @@/Gc.create_alarm3.create_alarm f2 will arrange for !f > to be called at the end of major GC cycles, not caused by !f = itself, starting with the current cycle or the next one. !f R will run on the same domain that created the alarm, until the domain exits or ,delete_alarm? is called. A value of type %alarm ) is returned that you can use to call ,delete_alarm!.@ It is not guaranteed that the Gc alarm runs at the end of every major GC cycle, but it is guaranteed that it will run eventually.@ { As an example, here is a crude way to interrupt a function if the memory consumption of the program exceeds a given %limit , in MB, suitable for use in the toplevel:@$ a let run_with_memory_limit (limit : int) (f : unit -> 'a) : 'a = let limit_memory () = let mem = Gc.(quick_stat ()).heap_words in if mem / (1024 * 1024) > limit / (Sys.word_size / 8) then raise Out_of_memory in let alarm = Gc.create_alarm limit_memory in Fun.protect f ~finally:(fun () -> Gc.delete_alarm alarm ; Gc.compact ()) @@@@@@@@@@@@J@ K@@@@5/Gc.delete_alarm3.delete_alarm a 6 will stop the calls to the function associated to !a*. Calling .delete_alarm a5 again has no effect.@@@@@@@@@@@@E@'F@@@@91Gc.eventlog_pause3@@@@@@@@@@@@9@5:@@@@02Gc.eventlog_resume3@@@@@@@@@@@@@C@@@@/*Gc.Memprof3'Memprof F is a profiling engine which randomly samples allocated memory words. Every allocated word has a probability of being sampled equal to a configurable sampling rate. Once a block is sampled, it becomes tracked. A tracked block triggers a user-defined callback as soon as it is allocated, promoted or deallocated.@ Since blocks are composed of several words, a block can potentially be sampled several times. If a block is sampled several times, then each of the callbacks is called once for each event of this block: the multiplicity is given in the )n_samples1 field of the *allocation+ structure.@ e This engine makes it possible to implement a low-overhead memory profiler as an OCaml library.@ J Note: this API is EXPERIMENTAL. It may change without prior notice.@@@@@@@@@@@@Aѐ#,Gc.Memprof.t35the type of a profile@@@@@@@@@@@@@@A@@@@#= 1).@@@@@@@@@@@@@@3 6The size of the block, in words, excluding the header.@@@@@@@@@@@@@@3 is the type of metadata to keep for minor blocks, and &'major . the type of metadata for major blocks.@ " The member functions in a 'tracker6 are called callbacks.@ U If an allocation or promotion callback raises an exception or returns $None 1, memprof stops tracking the corresponding block.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@A@@@@7Gc.Memprof.null_tracker3 Default callbacks simply return $None$ or "()@@@@@@@@@@@@@@@@y0Gc.Memprof.start3 *Start a profile with the given parameters.@ 3 Sampling begins immediately. The parameter -sampling_rate  is the sampling rate in samples per word (including headers). Usually, with cheap callbacks, a rate of 1e-4 has no visible effect on performance, and 1e-3 causes the program to run a few percent slower. 0.0 <= sampling_rate <= 1.0.@6 The parameter .callstack_size P is the length of the callstack recorded at every sample. Its default is 'max_int!.@6 The parameter 'tracker _ determines how to track sampled blocks over their lifetime in the minor and major heap.@  Sampling and running callbacks are temporarily disabled on the current thread when calling a callback, so callbacks do not need to be re-entrant if the program is single-threaded and single-domain. However, if threads or multiple domains are used, it is possible that several callbacks will run in parallel. In this case, callback functions must be re-entrant.@  Note that a callback may be postponed slightly after the actual event. The callstack passed to an allocation callback always accurately reflects the allocation, but the program state may have evolved between the allocation and the call to the callback.@ \ All the threads belonging to a domain share the same profile (using the same -sampling_rate", .callstack_size-, and 'tracker callbacks). In addition, if a new domain is spawned by the current domain while sampling for a profile, then the child domain likewise shares that profile with its parent.@ An allocation callback is always run by the thread which allocated the block. If the thread exits or the profile is stopped before the callback is called, the allocation callback is not called and the block is not tracked.@ Each subsequent callback is generally run by the domain which allocated the block. If the domain terminates or the profile is stopped before the callback is called, the callback may be run by a different domain.@ R Different domains may sample for different profiles simultaneously.@ T If a profile is already sampling in the current domain, then calling %start replaces it with a new profile in this domain. If the old profile was sampling in other domains, it continues doing so.@@@@@@@@@@@@@@@@@@@6Gc.Memprof.is_sampling3 UReturns whether a profile is sampling in the current domain, if any. Returns $None / if the current domain is not sampling.@@@@@@@@@@@@@@@@@/Gc.Memprof.stop3 Stop sampling for the current profile. Fails if no profile is sampling in the current domain. Stops sampling in all threads and domains sharing the profile.@ Q Promotion and deallocation callbacks from a profile may run after $stop2 is called, until 'discard " is applied to the profile.@ } A profile is implicitly stopped (but not discarded) if all domains and threads sampling for it are terminated.@@@@@@@@@@@@@@@@@2Gc.Memprof.discard3 Discards all profiling state for a stopped profile, which prevents any more callbacks for it. Raises an exception if called on a profile which has not been stopped.@@@@@@@@@@@@@@@@@@@@@@@@#