File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 44import numpy as np
55import inspect
66import importlib
7+ import gc
78from decimal import Decimal
89
910from element_interface .utils import find_root_directory , find_full_path , dict_to_uuid
@@ -326,6 +327,10 @@ def make(self, key):
326327 self .EphysFile .insert ([{** key ,
327328 'file_path' : fp .relative_to (root_dir ).as_posix ()}
328329 for fp in probe_data .recording_info ['recording_files' ]])
330+ # explicitly garbage collect "dataset"
331+ # as these may have large memory footprint and may not be cleared fast enough
332+ del probe_data , dataset
333+ gc .collect ()
329334 else :
330335 raise NotImplementedError (f'Processing ephys files from'
331336 f' acquisition software of type { acq_software } is'
Original file line number Diff line number Diff line change 44import numpy as np
55import inspect
66import importlib
7+ import gc
78from decimal import Decimal
89
910from element_interface .utils import find_root_directory , find_full_path , dict_to_uuid
@@ -273,6 +274,10 @@ def make(self, key):
273274 self .EphysFile .insert ([{** key ,
274275 'file_path' : fp .relative_to (root_dir ).as_posix ()}
275276 for fp in probe_data .recording_info ['recording_files' ]])
277+ # explicitly garbage collect "dataset"
278+ # as these may have large memory footprint and may not be cleared fast enough
279+ del probe_data , dataset
280+ gc .collect ()
276281 else :
277282 raise NotImplementedError (f'Processing ephys files from'
278283 f' acquisition software of type { acq_software } is'
Original file line number Diff line number Diff line change 44import numpy as np
55import inspect
66import importlib
7+ import gc
78from decimal import Decimal
89
910from element_interface .utils import find_root_directory , find_full_path , dict_to_uuid
@@ -325,6 +326,10 @@ def make(self, key):
325326 self .EphysFile .insert ([{** key ,
326327 'file_path' : fp .relative_to (root_dir ).as_posix ()}
327328 for fp in probe_data .recording_info ['recording_files' ]])
329+ # explicitly garbage collect "dataset"
330+ # as these may have large memory footprint and may not be cleared fast enough
331+ del probe_data , dataset
332+ gc .collect ()
328333 else :
329334 raise NotImplementedError (f'Processing ephys files from'
330335 f' acquisition software of type { acq_software } is'
You can’t perform that action at this time.
0 commit comments