Re: About homework 14

楼主: litchi (狂恋大屁股)   2004-05-30 15:48:20
※ 引述《Psycap (siraPcitsatnaF)》之铭言:
: The second try usgin matrix:
: attr(x,"dim")<-dimension
: x=t(x)
: matrix=cbind(y,x)
: The state of Memory used is:
: 2080 b88009 17 0 1288 24 8 R 99.9 0.0 6836:45 vim
: 3188 r92042 17 0 2171m 954m 716 R 95.4 94.6 2:15.40 R.bin
: It seems the same ?
However, data.frame and matrix are different in my experiment~
(under my Debian machine with CPU p3-667 and memory 160MB)
%MEM
9711 9 0 108m 81m 16m S 0.0 52.3 0:18.70 R.bin
9716 9 0 47748 46m 2260 S 0.0 29.7 0:04.02 R.bin
Process 9711 allocates a data.frame with size 2000x2000, and process
9716 allocates a matrix with the same size.
The statements execute in process 9711 is below
> m <- as.data.frame(matrix(0, 2000, 2000))
> gc()
The statements execute in process 9716 is below
> m <- matrix(0, 2000, 2000)
> gc()

Links booklink

Contact Us: admin [ a t ] ucptt.com