separation function is a memory hog
Bug #664479 reported by
Enno Middelberg
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyEphem |
Fix Released
|
High
|
Brandon Rhodes |
Bug Description
The function that calculates the separation of bodies (either in RA and Dec or in Az/El) consumes a lot of memory when called repeatedly. The following code grabs 1.5GB of RAM in a few seconds:
import ephem as e
centre=
target=
centre.compute()
target.compute()
for x in range(1e7):
sep=
If this isn't a bug then I'd like to know how I can call the separation function many times without it grabbing so much RAM.
Regards,
Enno
Changed in pyephem: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Enno, thank you very much for reporting this! And sorry for any trouble that this bug caused you; I'll buy you a beer if we ever wind up at a conference together. :-)
There was indeed a memory leak in separation() in the specific case that it is given coordinate sequences instead of bodies or observers. I have pushed a fix to the PyEphem Bitbucket repository, and will be releasing a new PyEphem version this weekend with the fix. Here is the changeset in the repository in case you want to try the new version before I do the release:
http:// bitbucket. org/brandon/ pyephem/ changeset/ 95bf603370e7
Let me know if you have any further problems!