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

feat: memory profiling #58

Merged
merged 1 commit into from
Nov 12, 2023
Merged

feat: memory profiling #58

merged 1 commit into from
Nov 12, 2023

Conversation

P403n1x87
Copy link
Owner

@P403n1x87 P403n1x87 commented Nov 4, 2023

We add memory profiling support in the form of Python memory domain allocator tracking. Because this is performed via tracing, the new memory mode adds considerable overhead, as expected.

The new feature is implemented by attaching the frame stack to an allocation event, which is then retrieved when a corresponding free event on the same memory address is performed. This allows for an accurate detection of potential memory leaks. Data is emitted at the sampling rate, but only if recent allocations have caused a change in the maximum resident memory. This is to avoid reporting allocation data in cases when this does not correspond to an actual increase in memory usage.

Preliminary comparisons to similar tools show that Echion's memory mode introduces much less overhead, allowing an allocation-intensive program to run much more quickly (but still about 4 times slower).

@P403n1x87 P403n1x87 self-assigned this Nov 4, 2023
@P403n1x87 P403n1x87 force-pushed the feat/memory-profiling branch 10 times, most recently from 6ba6b06 to f234e07 Compare November 11, 2023 23:35
@P403n1x87 P403n1x87 force-pushed the feat/memory-profiling branch from f234e07 to 8336fb8 Compare November 12, 2023 10:34
@P403n1x87 P403n1x87 marked this pull request as ready for review November 12, 2023 11:22
@P403n1x87 P403n1x87 merged commit c56dffe into main Nov 12, 2023
14 of 16 checks passed
@P403n1x87 P403n1x87 deleted the feat/memory-profiling branch November 12, 2023 15:31
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