Jump to content
Search Community

milos98

Members
  • Posts

    4
  • Joined

  • Last visited

milos98's Achievements

  1. Mistake was on my part. So pixijs uses webGL and it uses GPU for processing. What I didn't know is that you have to clean GPU memory by yourself because it won't be emptied by garbage collector, sooo I was missing sprite.destroy(). Destroying objects is recommended only in applications that are running for a long time, such as slot games Love your product, forum and support. Thanks a LOT for help.
  2. My callbacks are running simple logic, like set some button's interactive property to false etc. Nothing related to timelines or Sprites. Could it be that gsap is storing (in memory) objects it is animating and that's why I have problem? Even if nothing else is referencing them? Will this for sure delete all Sprites from memory? let sprites = [] sprites.push(Sprite.from(source1)) sprites.push(Sprite.from(source2)) let timeline = gsap.timeline({ paused: true }) timeline.to(sprites, pixi:{ x: 300 }) sprites = [] await timeline.play() timeline.kill() timeline = gsap.timeline() Does kill on parent timeline invoke kill on it's children timelines? And if so, if I set main timeline to null does that guarantee that all initiated objects are deleted?
  3. Hello, thanks for quick response. Is this: dataController.animationSequencer.kill() dataController.animationSequencer = gsap.timeline({ paused: true }) not the same as this? Does it not assign new instance of timeline to animationSequencer and destroys old one? dataController.animationSequencer.kill() dataController.animationSequencer = null dataController.animationSequencer = gsap.timeline({ paused: true }) I tried with this first, but still got memory leaks: dataController.clear() My timeline works properly in both cases (animation runs as predicted), but Transform objects are still piled on in memory, that's why I tried using invalidate too. There is no other place where I'm referencing animated stripes, so only suspect left is gsap. This is the way I'm adding animations to animationSequencer: public queueReelAnimation(aditionalStripes: number, animationDelay: number, someOtherArgs){ const reelTimeline = gsap.timeline() for (let i = 0; i < aditionalStripes; i++) this.insertStripe() reelTimeline.to(...) //1st part of animation .to(...) //2nd part of animation .to(...) //3rd part of animation this.stripes = this.stripes.slice(1, 4) dataController.animationSequencer.add(reelTimeline, `<${animationDelay}`) } On the side note, I would prefer to use kill instead of clear because I'm adding events to be triggered at certain point in animation. In docs I didn't find that clear removes those events from timeline and I want to be certain that they are gone. I'm adding events using .call(function, args, time).
  4. I am referring to highlighted item in memory snapshot: I'm making Slot machine using typescript, webpack, pixijs and gsap. I'm using gsap to animate spinning of the reels. After every spin, my app takes more and more memory and I think it is because of gsaps caching. I am using one timeline as animation sequencer, to which I'm adding individual animations of every reel. For every reel I implemented spinning as such: init new timeline make very long reel (to existing 3 slots i append N slots on top) add animation for that reel (just move it down for N positions) append timeline to animationSequencer (main timeline) crop slots array so that only final 3 remain animationSequencer is paused on creation and only played after all animations are queued as such: dataController.animationSequencer.play('spinReels').then(() => { dataController.animationSequencer.kill() dataController.animationSequencer= gsap.timeline({ paused: true }) }) I also tried adding dataController.animationSequencer.invalidate() before kill() but with no success. So my question is: if I want to ensure that nothing that gsap has animated is in cache, how do I do it? Does kill on animationSequencer propagate on all it's children? Does invalidate propagate? If Transform is not gsap created object than I'm sorry for my mistake.
×
×
  • Create New...