Free stale GPU residency entries and optionally flush the model cache
Source:R/memory-stats.R
amatrix_gc.RdScans the residency registry and removes entries whose backend no longer reports the associated device buffer as present. Such stale entries arise when a backend is unloaded or the device is reset between sessions. Optionally flushes all cached matrix factors (QR, Cholesky, SVD) from the session model cache.
Value
Invisibly, a list with two integer elements:
- dead_entries
Number of stale residency slots removed.
- cache_entries_cleared
Number of model-cache entries flushed (0 when
cache = FALSE).