
  -spec garbage_collect(Pid, OptionList) -> GCResult | async
                           when
                               Pid :: pid(),
                               RequestId :: term(),
                               Option ::
                                   {async, RequestId} |
                                   {type, major | minor},
                               OptionList :: [Option],
                               GCResult :: boolean().

Since:
  OTP 17.0

  Garbage collects the node local process identified by Pid.

  Option:

  {async, RequestId}:
    The function garbage_collect/2 returns the value async
    immediately after the request has been sent. When the request
    has been processed, the process that called this function is
    passed a message on the form {garbage_collect, RequestId,
    GCResult}.

  {type, 'major' | 'minor'}:
    Triggers garbage collection of requested type. Default value
    is 'major', which would trigger a fullsweep GC. The option 
    'minor' is considered a hint and may lead to either minor or
    major GC run.

  If Pid equals self(), and no async option has been passed,
  the garbage collection is performed at once, that is, the same as
  calling garbage_collect/0. Otherwise a request for garbage
  collection is sent to the process identified by Pid, and will be
  handled when appropriate. If no async option has been passed,
  the caller blocks until GCResult is available and can be
  returned.

  GCResult informs about the result of the garbage collection
  request as follows:

  true:
    The process identified by Pid has been garbage collected.

  false:
    No garbage collection was performed, as the process identified
    by Pid terminated before the request could be satisfied.

  Notice that the same caveats apply as for garbage_collect/0.

  Failures:

  badarg:
    If Pid is not a node local process identifier.

  badarg:
    If OptionList is an invalid list of options.
