Jump to content

Please help me with the memory leak bug


codart
 Share

Recommended Posts

2 hours ago, jonforum said:

with the new  chrome monitor , it can help you to find memory leak.

Can you share a screen with your issue ?

memory never empties? or where from what time does it increase radically?

image.thumb.png.badd04bc69b6991ed964734576cfee88.png

Hi! I know exactly where the leak happen.
You can open the sandbox, my app run within it. Please pick a mp3 file then see the effect as below:
image.thumb.png.dd16af4162621efdc70528d7b3efd45b.png

 

This is the snippet of code which I pretty sure cause the memory leak:
 

onTick(delta) {
    const data = this.visualizer.data;
    const { center, radius, inscrement } = this.caculatedFactors;
    // this.periodicRad += this.periodicRadInscreament;

    data.forEach((value, i) => {
      const circle = this.circles[i];
      const radian = inscrement * i;
      circle.x = center.x + (radius + value) * Math.cos(radian);
      circle.y = center.y + (radius + value) * Math.sin(radian);
    });

    if (!this.previousGroupTexture) {
      this.previousGroupTexture = this.app.renderer.generateTexture(this.group);
    }

    // if (this.app.ticker.elapsedMS % 100 == 0) {
    const temp = this.effectSprite.texture;

    this.effectSprite.texture = this.previousGroupTexture;

    this.group.alpha = 0.9;
    this.previousGroupTexture = this.app.renderer.generateTexture(this.group);
    this.group.alpha = 1;

    temp.destroy();
    // }

    // }
  }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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