Title: Memory leak when PythonEngine.Initialize/Shutdown is called in a loop · Issue #499 · pythonnet/pythonnet · GitHub
Open Graph Title: Memory leak when PythonEngine.Initialize/Shutdown is called in a loop · Issue #499 · pythonnet/pythonnet
X Title: Memory leak when PythonEngine.Initialize/Shutdown is called in a loop · Issue #499 · pythonnet/pythonnet
Description: Environment Pythonnet version: 2.3.0 Python version: 3.6.0 Operating System: Win7 x64 Details Hello all together, i started to use pythonnet for my application. I discovered a memory leak. I reduced my code to this to identify the leak. ...
Open Graph Description: Environment Pythonnet version: 2.3.0 Python version: 3.6.0 Operating System: Win7 x64 Details Hello all together, i started to use pythonnet for my application. I discovered a memory leak. I reduce...
X Description: Environment Pythonnet version: 2.3.0 Python version: 3.6.0 Operating System: Win7 x64 Details Hello all together, i started to use pythonnet for my application. I discovered a memory leak. I reduce...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/499
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Memory leak when PythonEngine.Initialize/Shutdown is called in a loop","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.3.0\r\n- Python version: 3.6.0\r\n- Operating System: Win7 x64\r\n\r\n### Details\r\n\r\nHello all together,\r\ni started to use pythonnet for my application. I discovered a memory leak. I reduced my code to this to identify the leak. It appears that Python.Shutdown() does not clear all references and memory. Here is a picture of my memory diagnostics. Do i miss something? Maybe someone of you has some info.\r\n\r\n[Memory diagnostics picture](https://picload.org/image/riwidglr/memory.png)\r\n\r\nHere is my c# code:\r\n\r\n static void Main(string[] args)\r\n {\r\n for (int i = 0; i \u003c 10000; i++)\r\n {\r\n Console.WriteLine($\"Cycle: {i}\");\r\n\r\n Console.WriteLine($\"Status: {PythonEngine.IsInitialized}\");\r\n\r\n if (!PythonEngine.IsInitialized)\r\n {\r\n Console.WriteLine(\"Initialize\");\r\n PythonEngine.Initialize();\r\n }\r\n\r\n Console.WriteLine($\"Status: {PythonEngine.IsInitialized}\");\r\n\r\n if (PythonEngine.IsInitialized)\r\n {\r\n Console.WriteLine(\"Shutdown\");\r\n PythonEngine.Shutdown();\r\n }\r\n\r\n Console.WriteLine($\"Status: {PythonEngine.IsInitialized}\");\r\n }\r\n\r\n Console.ReadLine();\r\n }\r\n\r\n\r\n","author":{"url":"https://github.com/RomzMcGriess","@type":"Person","name":"RomzMcGriess"},"datePublished":"2017-06-19T11:20:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/499/pythonnet/issues/499"}
| 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:57957dc6-f7bb-4ccc-9e73-a34e7915a850 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C44:21BA1E:357947:44B45D:69742987 |
| html-safe-nonce | a6e99365437d28fa80a3d7b899b842bc82c8a4f1e3377682d408b84740d0c2fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzQ0OjIxQkExRTozNTc5NDc6NDRCNDVEOjY5NzQyOTg3IiwidmlzaXRvcl9pZCI6IjQ3NTI5NjQ0NjgyNzI4MDIxODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3e373ca5b6ae6a594592ecbd24eea0aca5af7990459846224fb6d0122a0e635f |
| hovercard-subject-tag | issue:236858486 |
| 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/pythonnet/pythonnet/499/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fc6ed627b5b8aae75cc9b7fc66b9634e5ca6656afa6504b401af365dca918c92/pythonnet/pythonnet/issues/499 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fc6ed627b5b8aae75cc9b7fc66b9634e5ca6656afa6504b401af365dca918c92/pythonnet/pythonnet/issues/499 |
| og:image:alt | Environment Pythonnet version: 2.3.0 Python version: 3.6.0 Operating System: Win7 x64 Details Hello all together, i started to use pythonnet for my application. I discovered a memory leak. I reduce... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RomzMcGriess |
| hostname | github.com |
| expected-hostname | github.com |
| None | f0c542b740cf8c6c6deff23a0eeffd05a0e8bd35565559ca5ec1535bcbb67e5c |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| 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 | 4e27a77ef0bf22cd9328967ddc1e1c3dfa6ffe51 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width