bloomberg / pytest-memray

pytest plugin for easy integration of memray memory profiler
https://pytest-memray.readthedocs.io/en/latest/
Apache License 2.0
342 stars 24 forks source link

<root> shows high memory usage, but the flamegraph shows just a little portion of it #97

Closed rdbisme closed 12 months ago

rdbisme commented 12 months ago

Bug Report

Current Behavior A clear and concise description of the behavior. Not sure it's a bug, but, I'm trying to understand why a test allocates lots of memory.

pytest --memray --memray-bin-path=. 'tests/auto-check/core/test_correlation.py::test_correlation[...]'

Then

python -m memray flamegraph --temporal 2e8a7baff95e4d8ba3eb8d06bdece836-tests-auto-check-core-test_correlation.py-test_correlation\[...].bin

and I get the following flamegraph: [redacted]

The <root> call says 800+MB, but I can't understand what is allocating that.

Input Code Unfortunately is confidential :(

Expected behavior/code A clear and concise description of what you expected to happen (or code).

I'd expect to be able to understand what is allocating these 800Mb of memory

Environment

Possible Solution

Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

rdbisme commented 12 months ago

--native is the answer :)