Skip to content

Commit

Permalink
Started to investigate astropy#568. @johannesulf - this commit is my …
Browse files Browse the repository at this point in the history
…first attempt to eliminate obvious sources of the memory leak.
  • Loading branch information
Andrew Hearin committed Jun 27, 2016
1 parent fb1cd2d commit 0afe3f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions halotools/empirical_models/factories/hod_mock_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@ def preprocess_halo_catalog(self, halocat):
self._orig_halo_table = Table()
for key in self.additional_haloprops:
try:
self._orig_halo_table[key] = halo_table[key][:]
# self._orig_halo_table[key] = halo_table[key][:]
self._orig_halo_table[key] = np.copy(halo_table[key])
except KeyError:
raise HalotoolsError(unavailable_haloprop_msg % key)

del halo_table

self.model.build_lookup_tables()

def populate(self, **kwargs):
Expand Down Expand Up @@ -319,7 +322,10 @@ def allocate_memory(self):
``_occupation`` and ``_gal_type_indices``.
"""

try:
del self.galaxy_table
except AttributeError:
pass
self.galaxy_table = Table()

# We will keep track of the calling sequence with a list called _remaining_methods_to_call
Expand Down

0 comments on commit 0afe3f7

Please sign in to comment.