Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
jonForum

Garbage Collector and manage memory ?

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 post
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 post
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 post
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.

×