How to close or get rid of blank page which consumes unused memory
See original GitHub issueHey, when I tried your example code in headless:false mode it opens a blank page which is idle and stays until the task are completed. And if the task goes on for a long time this blank page is observed to use around 600 Mb. How can I get rid of that blank page since it consumes some memory ?
Here is your example code which reproduces this issue
const { Cluster } = require('../dist');
(async () => {
// Create a cluster with 2 workers
const cluster = await Cluster.launch({
puppeteerOptions: {
headless: false,
},
concurrency: Cluster.CONCURRENCY_CONTEXT,
maxConcurrency: 2,
});
// Define a task (in this case: screenshot of page)
await cluster.task(async ({ page, data: url }) => {
await page.goto(url);
const path = url.replace(/[^a-zA-Z]/g, '_') + '.png';
await page.screenshot({ path });
console.log(`Screenshot of ${url} saved: ${path}`);
});
// Add some pages to queue
cluster.queue('https://www.google.com');
cluster.queue('https://www.wikipedia.org');
cluster.queue('https://github.com/');
// Shutdown after everything is done
await cluster.idle();
await cluster.close();
})();
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Delete a blank page - Microsoft Support
You can get rid of a trailing blank page by saving the document as a PDF, leaving out the last page. Go to...
Read more >How To Stop RAM Usage in Windows 10 (Prevent High Usage)
Here are a few effective ways to stop high RAM usage in Windows 10: Close unused background programs. Disable startup programs.
Read more >7 Ways to Clear Memory and Boost RAM on Windows
1. RAM Hogs: Low Hanging Fruit · 2. Clean Up Startup Programs · 3. Clear Page File at Shutdown · 4. Check for...
Read more >How to Delete a Page in Word – Remove Blank or Extra Pages
You can also remove this extra blank page by simply pressing the BACKSPACE key. Conclusion. In this article, you learned how to remove...
Read more >How to delete a localStorage item when the browser window ...
Use localStorage.clear(); if you want to clear whole storage. – Black Mamba. Aug 12, 2017 at 6:40.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please don’t do this because then puppeteer-extra will not work properly! They only apply hooks on new pages not existing ones.
https://github.com/berstend/puppeteer-extra/issues/88
Yes, good point. This part could be improved by using the first (already open) page instead of opening another one…