maaaaz / webscreenshot

A simple script to screenshot a list of websites
GNU Lesser General Public License v3.0
653 stars 162 forks source link

FIX multiprocessing memory bug #43

Closed hyuckang closed 4 years ago

hyuckang commented 4 years ago

I found a bug using take_screenshot as a function in webscreenshot.py The program I made It's a simple program that takes a screenshot and takes a screenshot. Using the function as a daemon process, I found that the memory is not freed and continues to grow. The bug was caused by not closing the pool in webscreenshot.py

Thank you for making the program.

maaaaz commented 4 years ago

Hello @hyuckang, Thanks for reporting. This bug appeared (and disappeared with a call to close()) with Python 2.7 and 3.X ?

hyuckang commented 4 years ago

A bug that did not free memory existed in python3.X.

I solved the problem by calling pool.close ().

maaaaz commented 4 years ago

Ok, and should we add a join() after or before the close() ?

hyuckang commented 4 years ago

I did not join() before and after close(). This does not seem to affect the execution result. I think you can add join() after close ()

maaaaz commented 4 years ago

Hello, bug fixed in v2.9.