D.CODE Posted August 3, 2021 Share Posted August 3, 2021 Hi, guys In my Vue project, Scrolltrigger make huge memory leak. How can I fix it? 1. No memory leak(scrub 0) Detached HTML nodes -> GC 2. Memory leak(scrub greater than 0) Detached HTML nodes -> No GC Link to comment Share on other sites More sharing options...
GreenSock Posted August 3, 2021 Share Posted August 3, 2021 It's very difficult to troubleshoot blind but I think this has nothing to do with ScrollTrigger - the scrub doesn't add any DOM nodes at all. I imagine this has more to do with the framework you're using and it not releasing things if they're still being animated or something like that. Can you please provide a minimal demo that clearly illustrates the issue? 1 Link to comment Share on other sites More sharing options...
D.CODE Posted August 3, 2021 Author Share Posted August 3, 2021 @GreenSock Thanks for your comment. I think, scrubbed tween has a object reference still and It makes no memory release for Detached Nodes(it was tween target). Sorry for that I'm not friendly with codepen. And minimal demo required vuejs + router. I will find solution. But I can't be sure. Link to comment Share on other sites More sharing options...
OSUblake Posted August 3, 2021 Share Posted August 3, 2021 You can use codesandbox for Vue. But doesn't it take a couple minutes for the GC to catch up? 1 Link to comment Share on other sites More sharing options...
D.CODE Posted August 3, 2021 Author Share Posted August 3, 2021 @OSUblake In the video, as you can see, I forced GC(as clicking the trash can icon it immediately activates GC) your mention for codesandbox, It so helpful for me. I will make that. Link to comment Share on other sites More sharing options...
D.CODE Posted August 3, 2021 Author Share Posted August 3, 2021 @GreenSock Here is demo. It is weird. In the edit panel no memory leak. But external browsing make memory leak. editor: https://codesandbox.io/s/elegant-maxwell-319cr?file=/src/App.vue external: https://319cr.csb.app/ you can test with edit the scrub(in Home.vue) 0 -> no memory leak greater than 0 -> memory leak 1 Link to comment Share on other sites More sharing options...
OSUblake Posted August 3, 2021 Share Posted August 3, 2021 Interesting. I'm seeing with the same issue with 0. Looks like GSAP's cache isn't being cleared. Stand by while we look into this. 1 1 Link to comment Share on other sites More sharing options...
Solution GreenSock Posted August 3, 2021 Solution Share Posted August 3, 2021 I see the issue - it's due to the fact that the scrub tween is paused but not killed inside the ScrollTrigger's kill() method. I've patched that in the next release, but for now you can accomplish the same thing by doing this to kill everything: gsap.killTweensOf(tl); tl.scrollTrigger.kill(); tl.kill(); Does that resolve things for you? I'd also recommend updating to 3.7.1. 1 1 Link to comment Share on other sites More sharing options...
D.CODE Posted August 3, 2021 Author Share Posted August 3, 2021 @GreenSock @OSUblake It works perfectly 💯. So much appreciate!! You guys my lifesaver. PS: I used gsap 3.7.X but Scrolltrigger got some bugs. So I downgrade... Can you please recommend Scrolltrigger version for gsap 3.7.1? Link to comment Share on other sites More sharing options...
GreenSock Posted August 3, 2021 Share Posted August 3, 2021 10 hours ago, D.CODE said: PS: I used gsap 3.7.X but Scrolltrigger got some bugs. So I downgrade... I'm very curious about this - can you please elaborate? We're not aware of any other bugs at this point. Can you provide a minimal demo that shows what you think is a bug? 10 hours ago, D.CODE said: Can you please recommend Scrolltrigger version for gsap 3.7.1? I don't understand the question. I was recommending 3.7.1 (GSAP and ScrollTrigger) 1 Link to comment Share on other sites More sharing options...
D.CODE Posted August 4, 2021 Author Share Posted August 4, 2021 9 hours ago, GreenSock said: I don't understand the question. I was recommending 3.7.1 (GSAP and ScrollTrigger) I didn't know they were the same version. I will try. Thank you 🙋♂️ 9 hours ago, GreenSock said: I'm very curious about this - can you please elaborate? We're not aware of any other bugs at this point. Can you provide a minimal demo that shows what you think is a bug? Sorry, I can't make that bug intentionally. That was made Scrolltrigger wrong start point. Later, If I had some bug, I will make demo and share you. (Sorry my english. I'm not good, so I can't tell you detailedly.) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now