Suppressing functions
- Dominant language
- Python
- Stars
- 15.2k
- Forks
- 461
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 10
Description
### Is there an existing proposal for this?
- [X] I have searched the existing proposals
### Is your feature request related to a problem?
Python comes with several built-in "memory leaks" (for example, `re.compile`, from your docs), making it difficult to write code that doesn't get marked by Memray as leaking memory in some way or another.
### Describe the solution you'd like
Memray could support adding a suppressions file. This could be in an `ini` file (since that's in the [standard library](https://docs.python.org/3/library/configparser.html)), or make its own format - similar to how [Valgrind](https://wiki.wxwidgets.org/Valgrind_Suppression_File_Howto) does it.
### Alternatives you considered
I've considered modifying [get_allocations](https://github.com/bloomberg/memray/blob/main/src/memray/_memray.pyx#L1489) to manually remove some functions from the report.
Contributor guide
Research direction
Start by reading the proposal and the get_allocations entry point in src/memray/_memray.pyx around line 1489. Compare the requested suppressions-file behavior with the existing reporting flow and the linked Python documentation for configparser. Done means Memray can accept suppression rules and exclude matching functions from reports, with the supported format and behavior documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100