Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tile memory limits exceeded when taking screenshots of large pages #5530

Closed
pbnsilva opened this issue Mar 22, 2020 · 6 comments
Closed

Tile memory limits exceeded when taking screenshots of large pages #5530

pbnsilva opened this issue Mar 22, 2020 · 6 comments

Comments

@pbnsilva
Copy link

Screenshots of large pages are not rendered correctly. I understand this might be an issue with Chromium, but I wonder if the community here has any fixes.

  • Puppeteer version: 2.1.1
  • Platform / OS version: Ubuntu 18.04

What steps will reproduce the problem?
For large screenshots the fullPage:true does not work at all, so I screenshot regions at a time and then stitch them together. This works really well for pages that are less than 10k by 10k. See code:

 await page.setViewport({width: width, height: height, deviceScaleFactor: 1});

      var tiles = tilesGenerator(width, height, gridSizeMaxPixel);
      var numTiles = tiles.length;

      var index;
      for (index = 0; index < numTiles; ++index) {
          var tile = tiles[index];
          await page.screenshot({
            path: tile.fileName,
            type: format,
            clip: {
              x: tile.offsetX,
              y: tile.offsetY,
              width: tile.size.width,
              height: tile.size.height
            }
          });
      }

What is the expected result?
A set of images without any rendering issues.

What happens instead?
The screenshots have white parts in them (1st image), or some of the elements of the page are clipped (2nd image). Additionally, several errors like:

[0322/164044.687521:ERROR:tile_manager.cc(776)] WARNING: tile memory limits exceeded, some content may not draw

1584896108_1655_22032020_314x171
1584896126_1655_22032020_101x72

@rgazelot
Copy link

Having the same issue when a set a viewport close to 10px

@rgazelot
Copy link

@pbnsilva What are you using to stitch the images together according to your matrix and the position of each image in it?

@timparker183
Copy link

this looks very familiar - I tossed a rock into the ocean (issue 5300) and the silence has been deafening, so we reverted to Puppeteer 1.20 and all is well. at least until we're forced to migrate to Node 12

@pbnsilva
Copy link
Author

@rgazelot I'm using ImageMagick at a later step to do that.

@chianquan
Copy link

chianquan commented Mar 27, 2020

I have the same problem.
In my project,I have to screenshot a very high page.
Finaly I found a arg --force-gpu-mem-available-mb=4096 can resolve my problem.Just add it to puppeteer.launch 's 'args.
Hope useful for you ,@pbnsilva

@pbnsilva
Copy link
Author

pbnsilva commented Mar 27, 2020

This is really strange, but adding --force-gpu-mem-available-mb=4096 actually worked. Since one of my other flags is --disable-gpu, I'm especially confused.

Thanks @chianquan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants