memory - Confusing Size of objects in R -
> length(row) [1] 1000 > object.size(row) 8024 bytes > object.size(row[1]) 32 bytes here row list. above length of row 1000 , size of 1 of element 32 bytes. hence total size of list should 32*1000 bytes 8024 reason. reason of ?
initial overhead:
> row = runif(1000) > object.size(row[1]) 32 bytes > object.size(row[1:2]) 40 bytes > object.size(row[1:3]) 56 bytes > object.size(row[1:4]) 56 bytes 32 bytes length-1 vector plus 8 bytes each further element. there's other allocation funnies going on @ low end grabs 16 bytes, averages out @ 8.
the bytes @ start because r has keep length , other attributes somewhere.
require(plyr) size = ldply(1:200,function(i){object.size(row[1:i])})$v1 plot(1:200,size,type="l")
Comments
Post a Comment