Closed
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. 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.
Here is my c# code:
static void Main(string[] args)
{
for (int i = 0; i < 10000; i++)
{
Console.WriteLine($"Cycle: {i}");
Console.WriteLine($"Status: {PythonEngine.IsInitialized}");
if (!PythonEngine.IsInitialized)
{
Console.WriteLine("Initialize");
PythonEngine.Initialize();
}
Console.WriteLine($"Status: {PythonEngine.IsInitialized}");
if (PythonEngine.IsInitialized)
{
Console.WriteLine("Shutdown");
PythonEngine.Shutdown();
}
Console.WriteLine($"Status: {PythonEngine.IsInitialized}");
}
Console.ReadLine();
}