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

Make AcqProbs ref to parent acqs be a weakref #227

Merged
merged 3 commits into from
Jan 6, 2019
Merged

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Jan 5, 2019

Basically the same as #226, but applied to the 4.3.x branch.

The refactoring in master made it not possible to cherry pick the commits so I just applied the diffs from #226 by hand (in a "curated" way to make it right for 4.3.x).

Memory leak fix. The plot below shows memory usage (blue) for selecting 300 full catalogs on Mac:
plot

Testing:

  • Pass unit tests on Mac and HEAD linux-64 (ska3/flight), GRETA linux-32 (ska3/matlab32/test).
  • Write acq report for obsid 21068 and confirm no unexpected diffs in index.html from 4.3.1.

# contextual hack.
if self.cand_acqs is not None:
for probs in self.cand_acqs['probs']:
probs.acqs = weakref.ref(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me, but I'm not as clear about how we get to this point in the code. With that in mind does this need any new tests besides the two assert statements added in test_catalog?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically the unpickling post-processing code, so gets called when an AcqTable is unpickled. The existing tests (even without the two new asserts) will give an exception without this code. I've added a comment in the test code to explain why the asserts there are "strong" tests of this new functionality, agreed it wasn't obvious just from the asserts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also applied 0e0c201 to the #226 on master.

@mbaski
Copy link

mbaski commented Jan 6, 2019

These updates work on Windows and appear to resolve the memory leak (memory doesn't keep increasing each time a DOT is generated from ORViewer). The unit tests pass "105 passed in 55.53 seconds" on Windows and the DOT and associated files generated with this updated version of proseco using the dbtest/11706/DEC2418_11706.mat workspace are exactly the same as before the update (except for timestamps, of course).

@taldcroft taldcroft merged commit a1bf4fc into 4.3.x Jan 6, 2019
@taldcroft taldcroft deleted the memleak431 branch January 6, 2019 21:48
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

Successfully merging this pull request may close these issues.

3 participants