Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
Spacetime(3)			   OCamldoc			  Spacetime(3)

       Spacetime - Profiling of	a program's space behaviour over time.

       Module	Spacetime

       Module Spacetime
	: sig end

       Profiling  of  a	 program's  space behaviour over time.	Currently only
       supported on x86-64 platforms running 64-bit code.

       To use the functions in this module you must:

       -configure the compiler with "-spacetime";

       -compile	to native code.	 Without these conditions being	satisfied  the
       functions in this module	will have no effect.

       Instead of manually taking profiling heap snapshots with	this module it
       is possible to use an automatic snapshot	facility that writes profiling
       information  at	fixed  intervals  to  a	file. To enable	this, all that
       needs to	be done	is to build the	relevant program using a compiler con-
       figured	with -spacetime; and set the environment variable OCAML_SPACE-
       TIME_INTERVAL to	an integer number of milliseconds giving the  interval
       between	profiling heap snapshots. This interval	should not be made ex-
       cessively small relative	to the running time of the program. A  typical
       interval	 to  start with	might be 1/100 of the running time of the pro-
       gram.  The program must exit "normally" (i.e. by	calling	 exit  ,  with
       whatever	 exit  code, rather than being abnormally terminated by	a sig-
       nal) so that the	snapshot file is correctly completed.

       When using the automatic	snapshot mode the profiling output is  written
       to a file called	"spacetime-<pid>" where	<pid> is the process ID	of the
       program.	 (If the program forks and continues executing	then  multiple
       files  may be produced with different pid numbers.)  The	profiling out-
       put is by default written to the	current	 working  directory  when  the
       program	starts.	  This	may  be	customised by setting the OCAML_SPACE-
       TIME_SNAPSHOT_DIR environment variable to the name of the  desired  di-

       If  using  automatic snapshots the presence of the save_event_for_auto-
       matic_snapshots function, below,	should be noted.

       The functions in	this module are	thread safe.

       For functions to	decode the information recorded	by the	profiler,  see
       the Spacetime offline library in	otherlibs/.

       val enabled : bool

       enabled	is true	if the compiler	is configured with spacetime and false

       module Series : sig end

       module Snapshot : sig end

       val save_event_for_automatic_snapshots :	event_name:string -> unit

       Like Spacetime.Series.save_event	, but writes to	the automatic snapshot
       file.   This  function  is  a no-op if OCAML_SPACETIME_INTERVAL was not

2020-08-11			    source:			  Spacetime(3)

NAME | Module | Documentation

Want to link to this manual page? Use this URL:

home | help