Title: `tracemalloc` `backend` broken for `memory_usage` · Issue #402 · pythonprofilers/memory_profiler · GitHub
Open Graph Title: `tracemalloc` `backend` broken for `memory_usage` · Issue #402 · pythonprofilers/memory_profiler
X Title: `tracemalloc` `backend` broken for `memory_usage` · Issue #402 · pythonprofilers/memory_profiler
Description: from memory_profiler import memory_usage memory_usage(lambda _: x, backend="tracemalloc") gives Traceback (most recent call last): File "
Open Graph Description: from memory_profiler import memory_usage memory_usage(lambda _: x, backend="tracemalloc") gives Traceback (most recent call last): File "
X Description: from memory_profiler import memory_usage memory_usage(lambda _: x, backend="tracemalloc") gives Traceback (most recent call last): File "<stdin>", line 1, in <module>...
Opengraph URL: https://github.com/pythonprofilers/memory_profiler/issues/402
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`tracemalloc` `backend` broken for `memory_usage`","articleBody":"```python\r\nfrom memory_profiler import memory_usage\r\nmemory_usage(lambda _: x, backend=\"tracemalloc\")\r\n```\r\n\r\ngives\r\n\r\n```python\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/Users/ilangold/Projects/Theis/anndata/benchmarks/venv_mem/lib/python3.12/site-packages/memory_profiler.py\", line 369, in memory_usage\r\n p = MemTimer(os.getpid(), interval, child_conn, backend,\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/ilangold/Projects/Theis/anndata/benchmarks/venv_mem/lib/python3.12/site-packages/memory_profiler.py\", line 244, in __init__\r\n _get_memory(self.monitor_pid, self.backend, timestamps=self.timestamps,\r\n File \"/Users/ilangold/Projects/Theis/anndata/benchmarks/venv_mem/lib/python3.12/site-packages/memory_profiler.py\", line 212, in _get_memory\r\n raise RuntimeError(\r\nRuntimeError: There is no access to source file of the profiled function\r\n```\r\nEnv:\r\n```\r\nmemory-profiler==0.61.0\r\nPython 3.12.3 [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin\r\n```","author":{"url":"https://github.com/ilan-gold","@type":"Person","name":"ilan-gold"},"datePublished":"2024-06-05T13:28:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/402/memory_profiler/issues/402"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9b84f13b-69a9-7867-9f6c-4259b4ea87bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8AD0:11B886:3CF7D50:4FF2F8A:6992DFE1 |
| html-safe-nonce | f294a3c40f2fcdbe3e523b38ff52cc2f4af805838d421c7733112a67ea316031 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUQwOjExQjg4NjozQ0Y3RDUwOjRGRjJGOEE6Njk5MkRGRTEiLCJ2aXNpdG9yX2lkIjoiOTE3MDk1MTA3ODAxNTA2NjA4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 783f816dccbb4a304650d42c279bcf5ad71fe9dbd4b7d3b66cc1bf5f8bc957a5 |
| hovercard-subject-tag | issue:2335923943 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonprofilers/memory_profiler/402/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7302740318f0c618fa42f840051723273c8dc124087da0cadd00cf4b45494888/pythonprofilers/memory_profiler/issues/402 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7302740318f0c618fa42f840051723273c8dc124087da0cadd00cf4b45494888/pythonprofilers/memory_profiler/issues/402 |
| og:image:alt | from memory_profiler import memory_usage memory_usage(lambda _: x, backend="tracemalloc") gives Traceback (most recent call last): File " |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ilan-gold |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonprofilers/memory_profiler git https://github.com/pythonprofilers/memory_profiler.git |
| octolytics-dimension-user_id | 32906038 |
| octolytics-dimension-user_login | pythonprofilers |
| octolytics-dimension-repository_id | 2575826 |
| octolytics-dimension-repository_nwo | pythonprofilers/memory_profiler |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2575826 |
| octolytics-dimension-repository_network_root_nwo | pythonprofilers/memory_profiler |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84dcb133269e3cfe6e0296cc85fbacb92cae92bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width