The short answer is that R allocates space for vectors in multiples of 8 bytes, so not stepwise, not continuous increases.
# new session
pryr::mem_used()
#> 49.1 MB
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(pryr)
# after loading libraries
mem_used()
#> 55.2 MB
new_asd <- iris %>% group_by(Species) %>% summarise(Sepal.Length = sum(Sepal.Length))
# small object
object_size(new_asd)
#> 1,584 B
# but not quite a rounding error
mem_used()
#> 57.5 MB
new_asd_1 <- iris %>% group_by(Species) %>% summarise(Sepal.Length = sum(Sepal.Length))
# another small object
object_size(new_asd_1)
#> 1,584 B
# this time doesn't move the needle
mem_used()
#> 57.5 MB
# sum is less than its parts, probably because iris is duplicated
object_size(new_asd, new_asd_1)
#> 2,272 B
# nothing has been added, so needle doesn't move
mem_used()
#> 57.5 MB
# sum is less than its parts, probably because iris is duplicated
object_size(new_asd, new_asd_1)
#> 2,272 B
# nothing has been added, so needle doesn't move
mem_used()
#> 57.5 MB
57.5 MB - 0.002272MB = 57.49773 MB
Where is this remaining memory getting consumed?