Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Memory not released upon multiple Initialize/Shutdown #2594

Open
@Ledragon

Description

@Ledragon

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp