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 · 4 comments
Closed

Garbage collection of export_png() #8374

chyan26 opened this issue Oct 27, 2018 · 4 comments

Comments

@chyan26
Copy link

@chyan26 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

@philippjfr philippjfr commented Oct 28, 2018

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 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 mattpap commented Oct 28, 2018

Issue #6525 seems related.

@mattpap
Copy link
Contributor

@mattpap mattpap commented Oct 28, 2018

This seems to be a regression after PR #8329.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.