Quantcast
Channel: Determining memory usage of objects? - Stack Overflow
Browsing all 9 articles
Browse latest View live

Answer by TheNewGuy for Determining memory usage of objects?

I've used the solution from this linkfor (thing in ls()) { message(thing); print(object.size(get(thing)), units='auto') }Works fine!

View Article



Answer by rferrisx for Determining memory usage of objects?

A data.table function that separates memory and unit for easier sorting: ls.obj <- {as.data.table(sapply(ls(), function(x){format(object.size(get(x)),...

View Article

Answer by CGP for Determining memory usage of objects?

Here's a tidyverse-based function to calculate the size of all objects in your environment:weigh_environment <- function(env){ purrr::map_dfr(env, ~ tibble::tibble("object" = .) %>%...

View Article

Answer by filups21 for Determining memory usage of objects?

another (slightly prettier) option using dplyr data.frame('object' = ls()) %>% dplyr::mutate(size_unit = object %>%sapply(. %>% get() %>% object.size %>% format(., unit = 'auto')), size...

View Article

Answer by Blaszard for Determining memory usage of objects?

This question was posted and got legitimate answers so much ago, but I want to let you know another useful tips to get the size of an object using a library called gdata and its ll()...

View Article


Answer by doug for Determining memory usage of objects?

1. by object sizeto get memory allocation on an object-by-object basis, call object.size() and pass in the object of interest:object.size(My_Data_Frame)(unless the argument passed in is a variable, it...

View Article

Answer by Dirk is no longer here for Determining memory usage of objects?

You could try the lsos() function from this question:R> a <- rnorm(100)R> b <- LETTERSR> lsos() Type Size Rows Columnsb character 1496 26 NAa numeric 840 100 NAR>

View Article

Answer by JD Long for Determining memory usage of objects?

some time ago I stole this little nugget from here:sort( sapply(ls(),function(x){object.size(get(x))})) it has served me well

View Article


Determining memory usage of objects?

I'd like to work out how much RAM is being used by each of my objects inside my current workspace. Is there an easy way to do this?

View Article

Browsing all 9 articles
Browse latest View live




Latest Images