Skip to content

Allow tracing of external sources of allocation#5

Merged
lukemaurer merged 3 commits into
masterfrom
ext
Nov 30, 2020
Merged

Allow tracing of external sources of allocation#5
lukemaurer merged 3 commits into
masterfrom
ext

Conversation

@stedolan
Copy link
Copy Markdown
Collaborator

Adds Memtrace.External.{alloc,free}, so that non-heap allocations can be tracked in the same trace as heap allocations.

This works by reimplementing the Statmemprof sampling logic in OCaml, using this second sampler for non-heap allocations. The optimised sampling logic in geometric_sampler.ml is a port of the C code in the OCaml runtime and is extremely tricky. I recommend reviewing by reading the mli and tests.

cc @lukemaurer

Comment thread src/geometric_sampler.ml
Comment thread src/geometric_sampler.mli
Comment thread src/memprof_tracer.ml
Comment thread src/memprof_tracer.ml Outdated
@lukemaurer lukemaurer merged commit 79482da into master Nov 30, 2020
tmcgilchrist referenced this pull request in tmcgilchrist/memtrace May 6, 2025
Add self_memory_map example for macos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants