Skip to content

Commit feb169c

Browse files
committed
migration: add gc collect
1 parent ac71248 commit feb169c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pychunkedgraph/ingest/upgrade/parent_layer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pylint: disable=invalid-name, missing-docstring, c-extension-no-member
22

3-
import logging, random, time, os
3+
import logging, random, time, os, gc
44
import multiprocessing as mp
55
from collections import defaultdict
66
from datetime import datetime, timezone
@@ -175,6 +175,7 @@ def _update_cross_edges_helper(args):
175175
edges.PARENTS_CACHE.clear()
176176
edges.CHILDREN_CACHE.clear()
177177
cg.client.write(rows)
178+
gc.collect()
178179

179180

180181
def update_chunk(
@@ -215,7 +216,7 @@ def update_chunk(
215216
logging.info(f"total elaspsed time: {time.time() - start}")
216217
return
217218

218-
task_size = int(os.environ.get("TASK_SIZE", 10))
219+
task_size = int(os.environ.get("TASK_SIZE", 1))
219220
chunked_nodes = chunked(nodes, task_size)
220221
chunked_nodes_ts = chunked(nodes_ts, task_size)
221222
cg_info = cg.get_serialized_info()

0 commit comments

Comments
 (0)