The Broker uses XUTL^XUSCLEAN to clean up globals upon application termination.
In addition, there is an RPC return value type, GLOBAL ARRAY, where the application RPC returns a closed form global reference, for example:
^TMP("EKG",220333551)
The Broker kills the data for the global reference for this type of RPC at the end of RPC execution.