carsonyl / pypac

Find and use proxy auto-config (PAC) files with Python and Requests.
https://pypac.readthedocs.io
Apache License 2.0
71 stars 18 forks source link

Version 0.10.1 has a memory leak #32

Closed maximinus closed 5 years ago

maximinus commented 5 years ago

This is due to the new dukpy library.

An alternate dukpy fixes this, the merger request is here: https://github.com/carsonyl/pypac/pull/31

carsonyl commented 5 years ago

Given the findings in https://github.com/amol-/dukpy/issues/33#issuecomment-418850470, maybe this problem can be mitigated by keeping a dukpy.JSInterpreter instance as a global to reuse.

How severe are the leaks you're seeing? PyPAC currently instantiates one dukpy.JSInterpreter per PACFile, so I'm guessing that your use case involves the creation of many PACSession and PACFile.

maximinus commented 5 years ago

I found the memory leak in dukpy and raised a pull request here. Being a simple one-line addition, I'm hoping the change can be merged easily enough.

carsonyl commented 5 years ago

Thanks for fixing the leak in dukpy. I've released PyPAC 0.11.0 in order to depend on it.