Python: how to close doc after using OpenHeadless() ? / memory leak?

hi Ehsan,

I’ve just tried this on 8.8.24135.14001, 2024-05-14 and there is still a slow down.

Iteration: 0 0.31418275833129883 opened=True
Iteration: 1 0.044879913330078125 opened=True
Iteration: 2 0.03374624252319336 opened=True
Iteration: 3 0.03490471839904785 opened=True
Iteration: 4 0.03789997100830078 opened=True
Iteration: 5 0.03590250015258789 opened=True
Iteration: 6 0.036009788513183594 opened=True
Iteration: 7 0.0359044075012207 opened=True
Iteration: 8 0.03590512275695801 opened=True
Iteration: 9 0.031920433044433594 opened=True
Iteration: 10 0.04357409477233887 opened=True
Iteration: 990 0.22283291816711426 opened=True
Iteration: 991 0.24802589416503906 opened=True
Iteration: 992 0.2115778923034668 opened=True
Iteration: 993 0.20150232315063477 opened=True
Iteration: 994 0.2071995735168457 opened=True
Iteration: 995 0.23537373542785645 opened=True
Iteration: 996 0.22140932083129883 opened=True
Iteration: 997 0.20557069778442383 opened=True
Iteration: 998 0.2125532627105713 opened=True
Iteration: 999 0.21216702461242676 opened=True

I also noticed a different issue: When aborting with Escape once any further script run will only run through one iteration. Seems like Escape key is sticky and escape_test() only returns True.

1 Like

Okay let me run more tests on this. I swear the memory leak is solved but I need to check again :thinking:

Sounds good. Did your fix make it into the build?

@Laoky @Bernd_Möller

Okay I looked into this issue (Thanks @Laoky for the test files) and it seems there is an issue with not disposing some resources on the doc.Dispose() call that results in slower execution.

I have logged this and will fix

2 Likes

Rhino 8.9 is going to include improvements related to this issue.

1 Like