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

Enable memtrace on F* #3016

Merged
merged 3 commits into from
Aug 23, 2023
Merged

Enable memtrace on F* #3016

merged 3 commits into from
Aug 23, 2023

Conversation

mtzguido
Copy link
Member

This commit brings memtrace into F* to do memory profiling. It is (always) linked to F*, but does not do anything unless the MEMTRACE environment variable is set, so this should be zero-overhead (except for a few kb of binary size) when memtrace is not used. When used, the overhead is still supposed to be in the low digits of %.

With this enabled, we can just run

MEMTRACE=trace.ctf fstar.exe ..

to obtain a trace.ctf file with information about the allocations. This can then be inspected with the memtrace-viewer tool (installed separately, since it's quite big).

I think having this enabled by default would be useful, and the cost seems pretty low.

Some more info:
https://blog.janestreet.com/finding-memory-leaks-with-memtrace/
http://web.archive.org/web/20230528123929/https://blog.janestreet.com/finding-memory-leaks-with-memtrace/

This commit brings memtrace into F* to do memory profiling. It is
(always) linked to F*, but does not do anything unless the MEMTRACE
environment variable is set, so this should be zero-overhead (except
for a few kb of binary size) when memtrace is not used. When used, the
overhead is still supposed to be in the low digits of %.

With this enabled, we can just run

  MEMTRACE=trace.ctf fstar.exe ..

to obtain a trace.ctf file with information about the allocations.
This can then be inspected with the memtrace-viewer tool (installed
separately, since it's quite big).

I think having this enabled by default would be useful, and the cost
seems pretty low.

Some more info:
	https://blog.janestreet.com/finding-memory-leaks-with-memtrace/
	http://web.archive.org/web/20230528123929/https://blog.janestreet.com/finding-memory-leaks-with-memtrace/
@mtzguido mtzguido merged commit 3de85fc into FStarLang:master Aug 23, 2023
@mtzguido mtzguido deleted the memtrace branch August 23, 2023 17:54
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.

1 participant