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

tracemalloc backend broken for memory_usage #402

Open
ilan-gold opened this issue Jun 5, 2024 · 0 comments
Open

tracemalloc backend broken for memory_usage #402

ilan-gold opened this issue Jun 5, 2024 · 0 comments

Comments

@ilan-gold
Copy link

from memory_profiler import memory_usage
memory_usage(lambda _: x, backend="tracemalloc")

gives

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ilangold/Projects/Theis/anndata/benchmarks/venv_mem/lib/python3.12/site-packages/memory_profiler.py", line 369, in memory_usage
    p = MemTimer(os.getpid(), interval, child_conn, backend,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ilangold/Projects/Theis/anndata/benchmarks/venv_mem/lib/python3.12/site-packages/memory_profiler.py", line 244, in __init__
    _get_memory(self.monitor_pid, self.backend, timestamps=self.timestamps,
  File "/Users/ilangold/Projects/Theis/anndata/benchmarks/venv_mem/lib/python3.12/site-packages/memory_profiler.py", line 212, in _get_memory
    raise RuntimeError(
RuntimeError: There is no access to source file of the profiled function

Env:

memory-profiler==0.61.0
Python 3.12.3 [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
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

No branches or pull requests

1 participant