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

fix: memory issues #414

Merged
merged 15 commits into from
May 14, 2024
Merged

fix: memory issues #414

merged 15 commits into from
May 14, 2024

Conversation

kuruk-mm
Copy link
Member

@kuruk-mm kuruk-mm commented May 11, 2024

Fix #415

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 70.07042% with 85 lines in your changes are missing coverage. Please review.

Project coverage is 47.74%. Comparing base (0df27ef) to head (4d77015).
Report is 14 commits behind head on main.

Files Patch % Lines
...ntraland-godot-lib/src/content/content_provider.rs 70.09% 32 Missing ⚠️
...ntraland-godot-lib/src/godot_classes/dcl_config.rs 80.00% 11 Missing ⚠️
...and-godot-lib/src/godot_classes/resource_locker.rs 86.66% 4 Missing ⚠️
rust/decentraland-godot-lib/src/content/gltf.rs 84.21% 3 Missing ⚠️
...t-lib/src/scene_runner/components/avatar_attach.rs 0.00% 3 Missing ⚠️
...ot-lib/src/scene_runner/components/avatar_shape.rs 0.00% 3 Missing ⚠️
...ib/src/scene_runner/components/ui/ui_background.rs 0.00% 3 Missing ⚠️
...-lib/src/scene_runner/components/ui/ui_dropdown.rs 0.00% 3 Missing ⚠️
...dot-lib/src/scene_runner/components/ui/ui_input.rs 0.00% 3 Missing ⚠️
...odot-lib/src/scene_runner/components/ui/ui_text.rs 0.00% 3 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #414      +/-   ##
==========================================
+ Coverage   47.61%   47.74%   +0.12%     
==========================================
  Files         155      157       +2     
  Lines       19376    19599     +223     
==========================================
+ Hits         9226     9357     +131     
- Misses      10150    10242      +92     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@leanmendoza leanmendoza left a comment

Choose a reason for hiding this comment

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

Great work! It looks good.
Something I'm not really sure, using queue_free instead of remove_child it's ok in terms of memory management, but is it desirable to keep it parented to the given node until the end of the frame?

You also have commented code with remove_child

if self.tick >= 1.0 {
self.tick = 0.0;

self.cached = self
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be better to use self.cached.retain() and mutate it instead of creating a new one each time? Even with this rate 1/sec, it makes more sense

@kuruk-mm kuruk-mm marked this pull request as ready for review May 13, 2024 19:27
@kuruk-mm kuruk-mm merged commit d031b7e into main May 14, 2024
3 checks passed
@kuruk-mm kuruk-mm deleted the fix/memory-issues branch May 14, 2024 21:40
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.

Content Loading: fix memory issues (Godot)
3 participants