Adding to the list of useful answers: this OCamlPro post mentions performance profiling (not memory profiling) of native code on Linux using perf
(installed via package linux-tools
in Debian-like distributions).
Basically, you just need to run:
perf record -g ./native_program arguments
To produce a perf.data
file containing profiling data, and then run
perf report -g
To see the results.
It works better when using an OCaml release with frame pointers enabled (e.g. 4.02.1+fp
instead of 4.02.1
on OPAM).