streetmerchant icon indicating copy to clipboard operation
streetmerchant copied to clipboard

Cleanup temp puppeteer files before or after run

Open dyndragon opened this issue 3 years ago • 15 comments

Description

I've discovered over 20GB of temp folders generated in the local user temp directory in windows (C:\Users<username>\AppData\Local\puppeteer*) during the time I've been running nvidia-snatcher. Is there a way to reduce this or keep it cleaner?

Possible solution

Set logging level of chromium browser to error only, or even lower. Cleanup process on startup or shutdown?

dyndragon avatar Sep 29 '20 13:09 dyndragon

They must be cleaned at some point, my puppeteer chrome profile in /tmp only consumes 260MB and I've been running the script for well over a week. On Linux though, not Windows.

rodalpho avatar Sep 29 '20 18:09 rodalpho

They must be cleaned at some point, my puppeteer chrome profile in /tmp only consumes 260MB and I've been running the script for well over a week. On Linux though, not Windows.

I think we get our cache in /tmp/. Here's a good link for how often.


As for Windows users, yeah, it's a good idea. We should figure that out.

jef avatar Sep 30 '20 01:09 jef

On Windows 10 for me, the temp folders for all of the chrome instances live here: C:\Users\XXXX\AppData\Local\Temp

Many folders named puppeteer_dev_chrome_profile-guid

Mine is sitting at 5Gb at the moment, shutdown PC last night and powered on this morning.

g1forfun avatar Sep 30 '20 12:09 g1forfun

[Un?]surprisingly, Windows doesn't clean this up.

We can put this on the backlog.

jef avatar Sep 30 '20 18:09 jef

Same issue, 20GB of puppeteer_dev_chrome_profile folders. Disk cleanup doesn't remove them.

Dark-talon avatar Oct 03 '20 23:10 Dark-talon

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jan 05 '21 00:01 github-actions[bot]

We are trying to run end to end tests on lambda containers using webdriverIO. Temp files generated by puppeteer is creating problem as lambda user don't have access to write files in the container. Is there any configuration so that puppeteer will stop generating temp files?

rahul-raut avatar May 21 '21 09:05 rahul-raut

In out case the puppetter profile directories and files in the /tmp directory left a big VM unbootable. Would be nice if the library itself handled this instead of needed some devops solution for it.

luispablo avatar Aug 27 '21 13:08 luispablo

Would be nice if the library itself handled this instead of needed some devops solution for it.

Agreed.

jef avatar Oct 07 '21 21:10 jef

+1

joska1993 avatar May 16 '22 07:05 joska1993

Is there any solution to this?

MrKafr avatar Jul 13 '22 17:07 MrKafr

Just found 25GB of profile files in my /tmp folder, would be good if this was built in to tidy these up.

articleten-andy avatar Jul 19 '22 15:07 articleten-andy

still no solution?

UsVfxArtia avatar Oct 26 '22 19:10 UsVfxArtia

I solve that on my server by creating cron task to remove all files older than 15 days. I used rm -rf to remove files and directories.

find /tmp/puppeteer* -mtime +15 -exec rm -rf {} \;

Jakeroid avatar Mar 18 '23 08:03 Jakeroid

Also: find /tmp/.org.chromium.Chromium* -exec rm -rf {} ;

I solve that on my server by creating cron task to remove all files older than 15 days. I used rm -rf to remove files and directories.

find /tmp/puppeteer* -mtime +15 -exec rm -rf {} \;

vandspot avatar Jun 27 '23 21:06 vandspot