Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garbage collection of export_png() #8374

Closed
chyan26 opened this issue Oct 27, 2018 · 5 comments · Fixed by #8376
Closed

Garbage collection of export_png() #8374

chyan26 opened this issue Oct 27, 2018 · 5 comments · Fixed by #8376

Comments

@chyan26
Copy link

chyan26 commented Oct 27, 2018

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.

@philippjfr
Copy link
Contributor

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.

@chyan26
Copy link
Author

chyan26 commented Oct 28, 2018

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)    

So, I believe there is a way to fix the issue.

@mattpap
Copy link
Contributor

mattpap commented Oct 28, 2018

Issue #6525 seems related.

@mattpap
Copy link
Contributor

mattpap commented Oct 28, 2018

This seems to be a regression after PR #8329.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants