From 3416968113d67a062429938f6f18fff340aab990 Mon Sep 17 00:00:00 2001 From: Louis Pienaar Date: Wed, 28 Oct 2020 11:41:50 +0200 Subject: [PATCH] Update circleDetection.gsql Cleaning up previously visited list accumulators greatly improves memory usage for this algorithm. This is done by removing the edgeTupleList from the source in the post-Accum step as the new paths are already forwarded to the next vertexes in the path. To my understanding, at that point, there is no need to store the paths in source vertex. --- .../loop_detection_demo/queries/circleDetection.gsql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/demos/guru_scripts/loop_detection_demo/queries/circleDetection.gsql b/demos/guru_scripts/loop_detection_demo/queries/circleDetection.gsql index 7a3f36c00..1bf877108 100644 --- a/demos/guru_scripts/loop_detection_demo/queries/circleDetection.gsql +++ b/demos/guru_scripts/loop_detection_demo/queries/circleDetection.gsql @@ -266,7 +266,9 @@ CREATE QUERY circleDetection (vertex srcId, int stepLowLimit = 3, int s tgt.@edgeTupleList = tgt.@newEdgeTupleList, tgt.@receiveNewPath = true, tgt.@newEdgeTupleList.clear() - END + END, + //clean up to reduce memory footprint + src.@edgeTupleList.clear() HAVING tgt.@receiveNewPath == true ; @@ -302,7 +304,9 @@ CREATE QUERY circleDetection (vertex srcId, int stepLowLimit = 3, int s END, tgt.@receiveNewPath = true, tgt.@newEdgeTupleList.clear() - END + END, + //clean up to reduce memory footprint + src.@edgeTupleList.clear() HAVING tgt.@receiveNewPath == true and tgt != srcId ;