Jump to content
Search Community

Garbage Collector and manage memory ?

jonForum test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

hi guys, i noticed when i delete a objets, the easing still loaded in memory.
What the best way to manage your api for a video game ?
do i need to stock all instance in a buffer and batch destroys them ?

 

Example here, all those objects not exist in my render, they was deleted, but keep existing in memory from your API.

lbYcAy09_o.png

 

What best practice, recommendation for manage the garbage collector ?
Did you have something native implemented yet?

thanks

Link to comment
Share on other sites

You shouldn't need to worry about GC (well, aside from deleting your own references). GSAP does a sweep roughly every 2 seconds to release animations for GC. My guess is that you're expecting things to immediately get removed, but you need to wait a little time. The browser will determine when it actually wants to do its own sweep, but GSAP will release things on its own typically within 2 seconds after they're done. Does that answer your question? 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

20 hours ago, GreenSock said:

You shouldn't need to worry about GC (well, aside from deleting your own references). GSAP does a sweep roughly every 2 seconds to release animations for GC. My guess is that you're expecting things to immediately get removed, but you need to wait a little time. The browser will determine when it actually wants to do its own sweep, but GSAP will release things on its own typically within 2 seconds after they're done. Does that answer your question? 

ok yes , thank , i maybe do mistake somewhere , because i do the screenshot after 30 second :)
These good to know that all this is automatic, I'll investigate thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...