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

inter-process c/s to eliminate memory leak ? #13

Open
zcattacz opened this issue Mar 20, 2013 · 1 comment
Open

inter-process c/s to eliminate memory leak ? #13

zcattacz opened this issue Mar 20, 2013 · 1 comment

Comments

@zcattacz
Copy link

gh.exit() doesn't claim much memory back. a simple way to prove this:

import sys
from time import sleep
from ghost import Ghost
for i in range(0,10):
    print 'start ', i
    gh = Ghost(cache_dir='Z:/temp/')
    page, page_id = gh.create_page()
    try:
        page.open('http://taobao.com')
    except:
        print sys.exc_value
    gh.exit()
    print '>  closed ', i
    sleep(2)

its only opening 10 times the same page, the leak will eventually bog down the main process. this happens with the original Ghost.py too. It ok to scrap a few pages though.

As the current multitab version uses a C/S architecture, if it can be extended to an inter-process level. Then the process isolation can eliminate these problems for good. Especially when the user opens some poorly scripted page that halt the server, he can even forcefully restart the server, without breaking the control process.

I don't know how much effort this will take, maybe this could be a mile stone in some future release. 👍

@carrerasrodrigo
Copy link
Owner

@zcattacz Ghost should free the memory when you exit the process. I can see the problem and it should't be happening let me check this weekend and see what it's the problem!

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

No branches or pull requests

2 participants