memory_hogs: Find Memory Hogs

View source: R/memory_hogs.R

memory_hogsR Documentation

Find Memory Hogs

Description

List objects in an R environment by size.

Usage

memory_hogs(
  unit = c("b", "Kb", "Mb", "Gb", "Tb", "Pb"),
  return_numeric = TRUE,
  ...,
  envir = parent.frame()
)

Arguments

unit

The unit to use.

return_numeric

Return a numeric vector? If set to FALSE, a character vector including the unit will be returned, which might be less usable but easier to read.

...

Arguments passed to order, defaults to decreasing = FALSE.

envir

The environment where to look for objects.

Value

A named vector of memory usages.

See Also

Other R memory functions: wipe_clean(), wipe_tempdir()

Examples

va <- rep(mtcars, 1)
vb <- rep(mtcars, 1000)
vc <- rep(mtcars, 2000)
vd <- rep(mtcars, 100)
memory_hogs()
memory_hogs(unit = "Mb", decreasing = TRUE)
memory_hogs(unit = "Mb", decreasing = TRUE, return_numeric = FALSE)

fritools documentation built on Nov. 19, 2023, 1:06 a.m.