Commit Graph

41 Commits (master)

Author SHA1 Message Date
Stephen Dolan 6a3af5c926 Add Gc.Memprof.allocation_source 2020-11-17 11:17:52 +00:00
Leo White dfd0c0cc77 Report full major collections in Gc stats 2020-06-25 14:24:41 +01:00
Enguerrand Decorne b7f0494df5 Rewrite the instrumented runtime to store traces in the CTF format.
The instrumentation code in the instrumented runtime was replaced
with new APIs to gather runtime statistics and output them in a new format
(Common Trace Format).
This commit also exposes new functions in the Gc module to pause or resume
instrumentation during a program execution (Gc.eventlog_pause and
Gc.eventlog_resume).
2020-04-30 10:32:01 +02:00
Gabriel Scherer ff6b20098f Gc.Memprof.start: take a record instead of 5 optional parameters
The Gc.Memprof module provides a low-level API, that will hopefully be
paired with user libraries that provide high-level instrumentation
choices.

A natural question is: how are the higher-level API going to expose
their choice of instrumentation to their users? With the current
Memprof.start API (before this patch), they would have to either
provide their own `start` function wrapping Memprof.start, or provide
a tuple of callbacks for to their users to pass to Memprof.start
themselves.

    val start : params -> unit
    (* or *)
    val callback : params ->
      ((allocation -> foo option) * (allocation -> bar option) * ... )

With an explicit record, it is easier for libraries to expose an
instrumentation choice (possibility parametrized over
user-provided settings):

    val tracker : params -> (foo, bar) Gc.Memprof.tracker

In addition, providing a record instead of optional parameters makes
it much easier to provide "default settings" (helper functions) that
instantiates the types `'minor` and `'ḿajor`, see for example
`simple_tracker` in this patch (which stores the same information for
the minor and major heap, and does not observe promotion), or to later
define checking predicates that can verify that a given choice of
callbacks is sensible (for example: providing a major-dealloc callback
but no promotion callback (dropping all tracked value on promotion) is
probably not a good idea).

Bootstrap: to avoid requiring an awkward bootstrap, this commit keeps
the (now unused) function caml_memprof_start_byt unchanged -- it is
used in the bootstrap binaries, so removing it would break the
build. The intention is to remove it in the following commit.
2020-04-01 16:37:28 +02:00
Jacques-Henri Jourdan e1a22e80fb Memprof API: cannot be start if already running, cannot be stopped if not already running. 2020-01-14 10:42:16 +01:00
Jacques-Henri Jourdan 0c8416478c Drop support for tags in memprof.
They are somewhat difficult to handle for native allocations, and it is not clear how useful they are. Moreover, they are easy to add back since [Gc.Memprof.allocation] is a private record.
2020-01-11 13:19:10 +01:00
Jacques-Henri Jourdan 7dbbfce890 New ephemeron-free API for Memprof.
The user can register several callbacks, which are called for various
events during the block's lifetime. We need to maintain a data
structure for tracked blocks in the runtime. When using threads,
callbacks can be called concurrently in a reentrant way, so the
functions manipulating this data structure need to be reentrant.
2019-12-21 10:21:48 +01:00
Guillaume Munch-Maccagnoni 1220986b72 [minor] typo 2019-10-16 14:22:49 +02:00
Jacques-Henri Jourdan 90073e96e5 Memprof tracking of interned data. 2019-08-27 19:14:56 +02:00
Jacques-Henri Jourdan 052a950dea Statistical memory profiling of blocks allocated in the major heap. 2019-05-09 16:40:45 +02:00
Damien Doligez 17b64ac2b2
Add caml_alloc_custom_mem (#1738)
* add caml_alloc_custom_mem and corresponding GC parameters
* fix a bug in tests/misc/ephetest2.ml
2018-11-06 13:42:48 +01:00
Stephen Dolan f5412927ba Fix Gc.minor_{words,free} by removing [@@noalloc] 2017-03-09 14:51:09 +00:00
François Bobot bdc138cf82 Add finalise_last without special case during minor 2016-07-09 21:02:54 +02:00
Pierre Chambart 18c55e9242 Declare the Gc.minor_words external 2016-05-31 15:14:59 +02:00
Damien Doligez 520fb2df50 Merge tag 4.03.0 into trunk. 2016-04-28 16:13:21 +02:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Damien Doligez 0225ca01e3 GC latency improvements 2015-12-21 14:27:46 +01:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Xavier Leroy 09ba69134f - Refactoring of otherlibs/systhreads
- PR#4702: added C functions to register threads not created by Caml
- PR#5013: wrong implementation of condition variables under Win32
- PR#4979: wrong error code handling under Win32
- Added standard include <caml/threads.h> 
- Added "stack_size" field in GC statistics.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10315 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-04-27 07:55:08 +00:00
Damien Doligez 1f95b17570 merge changes from 3.10.2merged to 3.11.0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9153 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-12-03 18:09:09 +00:00
Damien Doligez cd64d89caf finalisation dans l'ordre
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6403 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-06-14 13:27:42 +00:00
Damien Doligez a28cc2b00f ajout Gc.quick_stat
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6097 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-01-30 14:29:04 +00:00
Damien Doligez 0c7aecb88d depollution suite (et fin?) (PR#1914 et PR#1956)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6047 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-01-02 19:23:29 +00:00
Damien Doligez 9cc58da13e PR#1786
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5767 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-08-07 14:17:59 +00:00
Damien Doligez 8ea64b58dc byterun/finalise.c: support pour les lazy finalises
byterun/gc_ctrl.c: ajout Gc.major_slice
byterun/major_gc.c: gros bug dans les valeurs finalisees + ajout Gc.major_slice
byterun/major_gc.h: gros bug dans les valeurs finalisees + ajout Gc.major_slice
byterun/memory.c: typo dans un commentaire
byterun/minor_gc.c: petit bug, ajout Gc.major_slice
parsing/parser.mly: plus de conflits; l'automate reste identique
stdlib/gc.ml: ajout Gc.major_slice
stdlib/gc.mli: ajout Gc.major_slice
stdlib/sys.ml: ajout Sys.ocaml_version
stdlib/sys.mli: ajout Sys.ocaml_version
utils/config.mlp: ajout Sys.ocaml_version


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4357 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-02-05 17:11:33 +00:00
Damien Doligez 15c25173cf ajout Gc.top_heap_words
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4335 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-02-01 12:23:58 +00:00
Xavier Leroy 7501784c80 MAJ en-tetes pour mentionner la 'special exception' sur la LGPL
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-12-07 13:41:02 +00:00
Damien Doligez c144e729ba PR#497
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3674 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-08-28 13:22:24 +00:00
Damien Doligez dcc3b0ce03 gc.ml, gc.mli: compteurs flottants
arg.ml: affichage option -help


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3399 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-02-05 14:59:24 +00:00
Damien Doligez 27445a2064 bug dans allocated_bytes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2754 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-01-12 14:19:27 +00:00
Damien Doligez 0a2021e986 finalisation de valeurs allouees
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2746 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-01-07 16:51:58 +00:00
Damien Doligez 8bc6dec9bb ajout Gc.counters et Gc.allocated_bytes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2645 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-29 20:02:33 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00
Damien Doligez 57c3913251 changement gc_message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2034 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1998-08-07 18:45:00 +00:00
Damien Doligez c194d39545 Paresseux.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1716 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-10-14 13:17:48 +00:00
Damien Doligez 98b6d9e18f compactage
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1539 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-05-13 14:45:38 +00:00
Xavier Leroy 2301d778e7 Renommage en Objective Caml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@782 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1996-04-30 14:53:58 +00:00
Xavier Leroy e4066357b1 Ajout des notices de copyright
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@195 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-08-09 15:06:35 +00:00
Xavier Leroy 414572e80b MAJ par-rapport a Caml Light 0.7
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@182 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-08-08 13:37:34 +00:00
Xavier Leroy 61bd8ace6b Passage a la version bootstrappee (franchissement du Rubicon)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-05-04 10:15:53 +00:00