Skip to content

Commit

Permalink
Merge pull request #915 from alejoe91/zarr_memory_leak
Browse files Browse the repository at this point in the history
Patch memory leak when saving to Zarr
  • Loading branch information
samuelgarcia committed Aug 29, 2022
2 parents 9a79b74 + 5a0efed commit 4633750
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spikeinterface/core/core_tools.py
Expand Up @@ -3,6 +3,7 @@
import sys
import datetime
from copy import deepcopy
import gc

import numpy as np
from tqdm import tqdm
Expand Down Expand Up @@ -703,6 +704,10 @@ def _write_zarr_chunk(segment_index, start_frame, end_frame, worker_ctx):
traces = traces.astype(dtype)
zarr_dataset[start_frame:end_frame, :] = traces

# fix memory leak by forcing garbage collection
del traces
gc.collect()


def determine_cast_unsigned(recording, dtype):
recording_dtype = np.dtype(recording.get_dtype())
Expand Down

0 comments on commit 4633750

Please sign in to comment.