1. Re[2]: About atom memories
- Posted by aku saya <akusaya at gmx.net> Feb 25, 2003
- 394 views
OK, thanks! Second test: object x x = rand(repeat(100000, 10*1024*1024)) ? x[1] x = getc(0) x = rand(repeat(100000, 20*1024*1024)) x = getc(0) When length(x) = 10MB, memory usage is 82276 KB ~~ 80.3 MB When length(x) = 20MB, memory usage is 164196 KB ~~ 160.3 MB so 1 atom = 8 byte??? not 4 byte in this case??? And I found that x[1] is always about 80000 < x[1] < 90000, not 0 < x[1] <= 100000 as I expected. A bug in rand() function? ______________________________________________ R> Aku writes: >> object x >> for i = 1024*1024 to 1000000000000000000000 by 1024*1024 do >> x = repeat(i+111111111.111111111111111111111111111111111, i) >> ? i >> printf(1, "%20.20f\n", x[i]) >> x = getc(0) >> end for >> >> after i = 10MB, I saw the memory usage (using TaskInfo2000), >> it was 41376 KB ~~ 40.4 MB >> >> So one atom just use 4 bytes, not 8 bytes? >> And the precision is still 16 digits! R> When i is 10 million, x will have 10 million 4-byte pointers to R> a single floating-point value. R> Regards, R> Rob Craig R> Rapid Deployment Software R> http://www.RapidEuphoria.com R> TOPICA - Start your own email discussion group. FREE!