Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor Scene Hierarchy Memory Leak #2268

Open
IXLLEGACYIXL opened this issue May 23, 2024 · 8 comments
Open

Editor Scene Hierarchy Memory Leak #2268

IXLLEGACYIXL opened this issue May 23, 2024 · 8 comments
Labels
area-GameStudio bug Something isn't working

Comments

@IXLLEGACYIXL
Copy link
Collaborator

Release Type: Official Release/GitHub (please choose appropriate option)
4.2

Describe the bug
The Editor has a memory leak in the assethierarchy or something that is connected to it

To Reproduce
Steps to reproduce the behavior:

  1. new standard project
  2. watch at your mb used ( around 300 )
  3. click through the scene hierarchy, order doesnt matter, just click on items in the scene hierarchy in random order
  4. swapping 4 times the item in the hierarchy , the usage goes up by 12mb and stays at that level

Expected behavior
The memory usage shouldnt just increase by clicking in the scene hierarchy

Screenshots
grafik
grafik

@IXLLEGACYIXL IXLLEGACYIXL added the bug Something isn't working label May 23, 2024
@IXLLEGACYIXL IXLLEGACYIXL changed the title Editor Memory Leak Editor Scene Hierarchy Memory Leak May 23, 2024
@Eideren
Copy link
Collaborator

Eideren commented May 23, 2024

This image shows some of the instances retained after selecting two different assets:
image
AssetRootNodePresenter seems like a good start, it likely is rooted somewhere and prevents its references from being collected. Here are the root paths for one of the two retained AssetRootNodePresenter:
image
So, all of the links to the node at the top should have released their reference to it but haven't for some reason. I don't have time to look into it further than this right now, so I'll leave it for now

@Kryptos-FR
Copy link
Member

We have a previous/next system (based upon the undo/redo stack) which records selection of items in asset view or in scene hierarchy, so it is expected to have slight increase in memory when changing selection.

@IXLLEGACYIXL
Copy link
Collaborator Author

the memory increasse is 6-7mb per click in the hierarchy, i didnt click often to reach 1gb of memory

it would make more sense to release the UI on click and on undo go back to the previous UI and build the UI again
overall in gamestudio its a problem that nothing is getting released

@Kryptos-FR
Copy link
Member

it would make more sense to release the UI on click and on undo go back to the previous UI and build the UI again

I have no idea what you mean by that.

@IXLLEGACYIXL
Copy link
Collaborator Author

lets say the method exists "BuildUiOnHierarchyClick"

currently you click, BuildUiOnHierarchyClick(target) runs, you click again, the UI gets stored in the undo command

instead of storing the entire UI in the UI command you can just store BuildUiOnHierarchyClick(previousTarget) , so if you undo you build the previous UI again, instead of storing the entire UI

@Kryptos-FR
Copy link
Member

There is no such thing, that's not how the undo/redo system works. It doesn't store anything related to UI.

@Kryptos-FR
Copy link
Member

With that said, the leaks are likely not in the scene editor itself but on the property grid (and/or quantum nodes). I can reproduce an increase in memory by switching between selecting a Scene asset and the GameSettings asset in the asset view.

@IXLLEGACYIXL
Copy link
Collaborator Author

With that said, the leaks are likely not in the scene editor itself but on the property grid (and/or quantum nodes). I can reproduce an increase in memory by switching between selecting a Scene asset and the GameSettings asset in the asset view.

a slight increase would be reasonable but 7mb per click is a little bit too much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-GameStudio bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants