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 4
4
import numpy as np
5
5
import inspect
6
6
import importlib
7
+ import gc
7
8
from decimal import Decimal
8
9
9
10
from element_interface .utils import find_root_directory , find_full_path , dict_to_uuid
@@ -326,6 +327,10 @@ def make(self, key):
326
327
self .EphysFile .insert ([{** key ,
327
328
'file_path' : fp .relative_to (root_dir ).as_posix ()}
328
329
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 ()
329
334
else :
330
335
raise NotImplementedError (f'Processing ephys files from'
331
336
f' acquisition software of type { acq_software } is'
Original file line number Diff line number Diff line change 4
4
import numpy as np
5
5
import inspect
6
6
import importlib
7
+ import gc
7
8
from decimal import Decimal
8
9
9
10
from element_interface .utils import find_root_directory , find_full_path , dict_to_uuid
@@ -273,6 +274,10 @@ def make(self, key):
273
274
self .EphysFile .insert ([{** key ,
274
275
'file_path' : fp .relative_to (root_dir ).as_posix ()}
275
276
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 ()
276
281
else :
277
282
raise NotImplementedError (f'Processing ephys files from'
278
283
f' acquisition software of type { acq_software } is'
Original file line number Diff line number Diff line change 4
4
import numpy as np
5
5
import inspect
6
6
import importlib
7
+ import gc
7
8
from decimal import Decimal
8
9
9
10
from element_interface .utils import find_root_directory , find_full_path , dict_to_uuid
@@ -325,6 +326,10 @@ def make(self, key):
325
326
self .EphysFile .insert ([{** key ,
326
327
'file_path' : fp .relative_to (root_dir ).as_posix ()}
327
328
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 ()
328
333
else :
329
334
raise NotImplementedError (f'Processing ephys files from'
330
335
f' acquisition software of type { acq_software } is'
You can’t perform that action at this time.
0 commit comments