필터 지우기
필터 지우기

release .net objects

조회 수: 6 (최근 30일)
Roberto Olmi
Roberto Olmi 2020년 1월 8일
답변: Roberto Olmi 2020년 1월 8일
If I create a .NET object instance, then that instance is never garbage collected, even if I call "clear all"
  댓글 수: 4
Roberto Olmi
Roberto Olmi 2020년 1월 8일
I increased the for iterations above to
for i=1:100
this is the result as seen by the memory profiler application:
Capture.PNG
Capture.PNG
Guillaume
Guillaume 2020년 1월 8일
The delete calls should have released all the references that matlab holds to your objects. The garbage collection itself is handled by .Net itself. Could it be that your LayoutLoader keeps hold of references to the objects?

댓글을 달려면 로그인하십시오.

채택된 답변

Roberto Olmi
Roberto Olmi 2020년 1월 8일
Dear Guillaume,
thanks a lot for you help. I understood that my objects couldn't be collected because they were used inside a separated thread that was never stopped after object creation.
Stopping that thread before calling delete allows the object to be garbage ollected.
Thanks again
Roberto

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Getting Started with Microsoft .NET에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by