Returns a snapshot of GPU device memory usage and model cache
occupancy for the current session. Backends that expose a
memory_usage() method contribute device byte counts;
backends without that method show NA for byte fields.
Value
An object of class amatrix_memory_stats, which is a
list with two components:
- residency
data.frame with one row per registered backend and columns
backend(character),resident_objects(integer count of GPU-resident R objects),bytes_used(numeric, device bytes in use, orNA), andbytes_total(numeric, total device capacity, orNA).- model_cache
List with
n_entries(integer, number of cached matrix factors) andmax_size(integer orInf, the cache size limit).
Examples
stats <- amatrix_memory_stats()
print(stats)
#> -- amatrix memory stats ----------------------------------------
#> model cache: 0 entries (max: unlimited)
#> residency:
#> cpu 0 resident object(s)
#> ----------------------------------------------------------------