Calling "global.__collect()"?


I’ve seen several threads and issues (ex1, ex2, and ex3) referencing the command “global.__collect()” as a means to manually run the garbage collector on iOS, but when I try using it in my Angular projects, I get the error “Property ‘__collect()’ does not exist on type ‘Global’.” Has anyone else experienced this?

For reference, I am attempting to run this code:

public collectGarbage() {
  if (isIOS) {
    global.__collect(); // this line raises the error


@lin-brian-l It’s just the TypeScript definition, you can do something like


But a more convenient / cross platform way will be

import { GC } from "utils/utils";



Oops, I was under the impression that GC() was an Android-specific function. Thanks for your help as always, @manojdcoder!