I am using export_png() for producing images. However, the phamtonjs process does not go away when program is fiished. After running the program for few times, I need to clean the phamtonjs process before it eat up all memory.
Therefore, I am writing to ask a possible way to do garbage collection after export_png() is done.
The text was updated successfully, but these errors were encountered:
I've noticed the same thing. In holoviews we use static export to generate thumbnails for our examples, and when building the docs I end up with about 100 phantomjs processes, which use an inordinate amount of CPU.
My solution is a little bit ugly. I did something like this.
# Garbage collection for Phantomjs. This is because it produce one process after export_png()
p = subprocess.Popen(['ps', '-A'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
if b'phantom' in line:
pid = int(line.split(None, 1)[0])
os.kill(pid, signal.SIGKILL)
I am using export_png() for producing images. However, the phamtonjs process does not go away when program is fiished. After running the program for few times, I need to clean the phamtonjs process before it eat up all memory.
Therefore, I am writing to ask a possible way to do garbage collection after export_png() is done.
The text was updated successfully, but these errors were encountered: