jasonraimondi / url-to-png

Selfhosted. URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB
https://jasonraimondi.github.io/url-to-png/
MIT License
136 stars 26 forks source link

memory not freed after each request #1

Closed diamondraras closed 4 years ago

diamondraras commented 4 years ago

the captures of each pages are stored in the memory and are not freed therefore usable in production it is preferable to close() image buffer after each request

jasonraimondi commented 4 years ago

Thanks for the tips, that makes sense. I would gladly take and accept a PR with the .close() call added. I can try and update it in the near future if I dont hear back.

jasonraimondi commented 4 years ago

@diamondraras I've added the page.close() call here. I watched the memory output in the docker container with docker stats and it the close call looks like it helped. I've also upgraded deps in the 0.12.x version.

docker run --rm -p 3000:3000 -m 256m jasonraimondi/url-to-png:0.12.1

And in a separate terminal:

docker stats

Thanks for the comment!