import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { garbagecollect } = fn;
Cleanup unused Lists
, Dictionaries
, Channels
and Jobs
that have circular references.
There is hardly ever a need to invoke this function, as it is
automatically done when Vim runs out of memory or is waiting
for the user to press a key after 'updatetime'. Items without
circular references are always freed when they become unused.
This is useful if you have deleted a very big List
and/or
Dictionary
with circular references in a script that runs
for a long time.
When the optional {atexit} argument is one, garbage collection will also be done when exiting Vim, if it wasn't done before. This is useful when checking for memory leaks.
The garbage collection is not done immediately but only when
it's safe to perform. This is when waiting for the user to
type a character. To force garbage collection immediately use
test_garbagecollect_now()
.