Skip to content

Commit

Permalink
adding manual garbage collection to keep docker containers from faili…
Browse files Browse the repository at this point in the history
…ng due to memory limit and to work with heap size hint
  • Loading branch information
jw2249a committed Sep 17, 2024
1 parent 6936cb6 commit dd93bc5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/fastlink/fastlink.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,18 @@ function fastLink(dfA::DataFrame, dfB::DataFrame, config::Dict{String,Any})
dfB[!,v],
res[v];
comparisons_args...)
end
end
# manual garbage collection needs to be initiated
GC.gc()
end
# reduction in columns to preserve memory only idvar should be left after
select!(dfA, Not(v))
select!(dfB, Not(v))
end

results = process_comparisons(res, emlink_configuration, _dims, parameters, tf_tables)

# manual garbage collection needs to be initiated
GC.gc()
if length(results) == 3
return Dict("idvar" => config["idvar"],
"ids" => indices_to_uids(dfA[!, config["idvar"][1]],dfB[!, config["idvar"][2]],results[1].indices),
Expand Down Expand Up @@ -222,7 +225,9 @@ function fastLink(dfA::DataFrame, dfB::DataFrame, config::Dict{String,Any}, benc
dfB[!,v],
res[v];
comparisons_args...)
end
end
# manual garbage collection needs to be initiated
GC.gc()
end
# reduction in columns to preserve memory only idvar should be left after
select!(dfA, Not(v))
Expand All @@ -231,7 +236,8 @@ function fastLink(dfA::DataFrame, dfB::DataFrame, config::Dict{String,Any}, benc
end

results = process_comparisons(res, emlink_configuration, _dims, parameters, tf_tables)

# manual garbage collection needs to be initiated
GC.gc()
if length(results) == 3
return Dict("idvar" => config["idvar"],
"ids" => indices_to_uids(dfA[!, config["idvar"][1]],dfB[!, config["idvar"][2]],results[1].indices),
Expand Down

0 comments on commit dd93bc5

Please sign in to comment.