Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
Page crashing due to an enormous amount of workers spawning

I'm using this library(https://github.com/spite/ccapture.js/) to generate animated gifs from a canvas. I'm generating a significant amount of files (hundreds), which are generated as blobs and downloaded.

I'm facing a problem that, when I make a loop to generate these gifs, an enormous amout of workers are being spawned and not killed, which end up crashing the page. Here's my code:

for(i=0;i<100;i++){

     let capturer = new CCapture({
        framerate: 10,
        format: "gif",
        workersPath: "js/"
      });

      capturer.start();

      for (let currentFrame = 0; currentFrame < totalFrames; currentFrame++) {
        this.gifRender(currentFrame / totalFrames);
        capturer.capture(canvas);
      }

      capturer.stop();

      capturer.save();

}

When running this code I can see hundreds of workers being generated and piling up in my memory causing the page to crash.

I found out that this library uses this: https://github.com/jnordberg/gif.js to generate gifs. I have dived into both libraries files but couldn't find a way to fix the problem.

Reusing the same object is not possible, as there is no 'reset' method to clear it.

Have been debugging this for 10 hours now. Can anyone help?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!