Function nmem_exit calls oid_exit (when reference is 0).