Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GC callbacks #6675

vicuna opened this issue Nov 25, 2014 · 1 comment


None yet
1 participant
Copy link

commented Nov 25, 2014

Original bug ID: 6675
Reporter: roshanjames
Status: closed (set by @damiendoligez on 2015-02-10T15:27:10Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: runtime system and C interface
Monitored by: @gasche @diml @ygrek

Bug description

When writing performance sensitive programs, one spends a lot of time worrying about the time spent in the GC. However there are very few tools available to directly measure the time spent in the GC.

Can we have the OCaml runtime fire a C callback when:

  • about to start a minor GC
  • about to start a major slice in a minor GC
  • end of major slice in a minor GC
  • end of a GC

It would be nice to have an interface where the user can supply C functions pointers for these situations. I imagine there will be constraints on the C callbacks -- for example, the callbacks must not modify or allocate OCaml memory.


This comment has been minimized.

Copy link

commented Feb 10, 2015

Comment author: @damiendoligez

Implemented in 4.02 branch (commit 15835).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.