You can easily turn off garbage collection by changing the source code for V8.
In the V8 source, edit src / heap.cc and place the return statement at the beginning of Heap :: CollectGarbage.
Other than that, this is not possible (AFAICT): V8 will always cause garbage collection when it runs out of memory. There is no (custom) way to do this.
source share