Skip to content

Conversation

@mjkkirschner
Copy link
Member

@mjkkirschner mjkkirschner commented Aug 29, 2023

Purpose

Before this PR each time you opened Dynamo and closed the splash screen, > 10 megs would leak as well as an entire DynamoView and everything else in the tree.

This PR leaves only 1 extra DynamoView, I need to investigate the TODO before this is merged.

Will continue looking at more complex workflows when I have bandwidth.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

Fixes some memory leaks from repeatedly opening and closing Dynamo's splash screen

Reviewers

@mjkkirschner mjkkirschner added the DNM Do not merge. For PRs. label Aug 29, 2023
@mjkkirschner mjkkirschner modified the milestones: 2.19.0, 3.0 Aug 29, 2023
Close();
viewModel.RequestClose -= SplashScreenRequestClose;
//viewModel?.Model.ShutDown(false);
//TODO ensure viewmodel is shutdown by view being disposed.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I verified this, but I will double check - IMO there is no reason to shutdown the view model because what we really need to do is dispose the DynamoView which will shutdown the view model - but again - I will verify.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I've verified that the close call on DynamoView will shutdown the model and view model under normal circumstances. When in testmode this is handled by the teardown logic of most test base classes. I think this change is safe.
PTAL.

@github-actions
Copy link

github-actions bot commented Aug 29, 2023

⚠️ [run-bin-diff] - Files Added/Deleted::72 new file(s) have been added and 153 file(s) have been deleted!
⚠️ [run-bin-diff-net60-windows] - Files Added/Deleted::12 new file(s) have been added and 29 file(s) have been deleted!
(Updated: 2023-08-31-23:46:05)

@mjkkirschner mjkkirschner removed the DNM Do not merge. For PRs. label Aug 31, 2023
@mjkkirschner mjkkirschner merged commit 8bc7453 into RC2.19.0_master Sep 1, 2023
@mjkkirschner mjkkirschner deleted the 219memleaks branch September 1, 2023 14:55
mjkkirschner added a commit to mjkkirschner/Dynamo that referenced this pull request Sep 1, 2023
…ynamoDS#14344)

* fixing mem leaks in progress

* fix test and remove todo
DynamoViewModel.CurrentSpaceViewModel.Model.NodeAdded -= OnNodeAdded;
DynamoViewModel.Model.Logger.NotificationLogged -= OnNotificationLogged;
CurrentWorkspace.RequestPackageDependencies -= PythonDependencies.AddPythonPackageDependency;
if (LoadedParams != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were there null reference exceptions being thrown with all these objects earlier?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes during shutdown directly from the splash screen being closed.

mjkkirschner added a commit that referenced this pull request Sep 1, 2023
…14344) (#14364)

* fixing mem leaks in progress

* fix test and remove todo
mjkkirschner added a commit that referenced this pull request Sep 1, 2023
* fix most memory leaks from opening and closing Dynamo Splash Screen (#14344)

* fixing mem leaks in progress

* fix test and remove todo

* attempt to fix dispose issue in docs browser view
get rid of redudant try/catch
cleanup log event in docs browser extension
replace item produced lambda with named method
fix broken dispose logic in nodeautocompletesearchcontrol - it was always hanging onto static event
implement dispose on viewextensioncommandexec
on dynamoviewmodel dispose, also dispose all workspaces - their remove methods are not called...
fix entry added lambda in searchviewmodel
dynamoview now disposes workspace view and node autocomplete search - TODO here.
workspaceview implement idisposable and cleans up view model subscriptions
direct manip extension was not cleaning up settings prop changed.
graph meta data view was not cleaning up current workspace cleared event
attempt to cleanup browser com refs... not sure this is helping

* review comment
mjkkirschner added a commit that referenced this pull request Sep 11, 2023
* fix most memory leaks from opening and closing Dynamo Splash Screen (#14344)

* fixing mem leaks in progress

* fix test and remove todo

* 2.19.1 disable network traffic WIP (#14393)

* cherry pick analytics issue (#13328)

* update

* update

* null checking

* update

* Update CoreNodeModelWpfResources.Designer.cs

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* Revert "cherry pick analytics issue (#13328)"

This reverts commit 6f9761d.

* cherry pick analytics issue (#13328) (#14085)

* update

* update

* null checking

* update

* Update CoreNodeModelWpfResources.Designer.cs

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* Disable net traffic (#14083)

* disable net traffic example

* Update PackageManagerViewExtension.cs

* update

* Update DynamoModel.cs

* Update PackageManagerViewExtension.cs

* Update PackageManagerViewExtension.cs

---------

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* Update PreferencesViewModel.cs: crash due to null feature flags (#14087)

* Update PreferencesViewModel.cs

* Update PackageManagerViewExtensionTests.cs

---------

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* changes

* remove comment

* comments and disable notifications

---------

Co-authored-by: pinzart90 <46732933+pinzart90@users.noreply.github.com>
Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

---------

Co-authored-by: pinzart90 <46732933+pinzart90@users.noreply.github.com>
Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>
mjkkirschner added a commit that referenced this pull request Sep 19, 2023
* fix most memory leaks from opening and closing Dynamo Splash Screen (#14344)

* fixing mem leaks in progress

* fix test and remove todo

* 2.19.1 disable network traffic WIP (#14393)

* cherry pick analytics issue (#13328)

* update

* update

* null checking

* update

* Update CoreNodeModelWpfResources.Designer.cs

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* Revert "cherry pick analytics issue (#13328)"

This reverts commit 6f9761d.

* cherry pick analytics issue (#13328) (#14085)

* update

* update

* null checking

* update

* Update CoreNodeModelWpfResources.Designer.cs

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* Disable net traffic (#14083)

* disable net traffic example

* Update PackageManagerViewExtension.cs

* update

* Update DynamoModel.cs

* Update PackageManagerViewExtension.cs

* Update PackageManagerViewExtension.cs

---------

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* Update PreferencesViewModel.cs: crash due to null feature flags (#14087)

* Update PreferencesViewModel.cs

* Update PackageManagerViewExtensionTests.cs

---------

Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* changes

* remove comment

* comments and disable notifications

---------

Co-authored-by: pinzart90 <46732933+pinzart90@users.noreply.github.com>
Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>

* add python tests

* move project

* revert

---------

Co-authored-by: pinzart90 <46732933+pinzart90@users.noreply.github.com>
Co-authored-by: pinzart <tiberiu.pinzariu@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants