- Notifications
You must be signed in to change notification settings - Fork749
Open
Description
Exectuing the following code in a basic Console app leads to the application consuming more and more memory:
Runtime.Runtime.PythonDLL=@"C:\ProgramData\WideTech\Python\python38.dll";PythonEngine.PythonHome=@"C:\ProgramData\WideTech\Python\";varcount=1000;for(inti=0;i<count;i++){PythonEngine.Initialize();PythonEngine.Shutdown();}
I am on windows 11 (64bit), using PythonNet v3.0.5, combined with Python 3.8 (happens with Python 3.12 as well).
For more context, we have a WebAPI that runs python 3 code that interacts with C# code. I tried avoiding initalization and shutdown systematically, but then I encounter API crashes. While current implementation might not be perfect (especially given2008 - that we are facing as well, but is not the topic), it works, besides the increasing memory consumption.
Am I missing anything regarding resources freeing?
Metadata
Metadata
Assignees
Labels
No labels