1

Build a 100.000.000 by 10 element SparseArray.
Fill position 1/1 and 100.000.000/10 with a value 999.999.999.999.999.

num = 999999999999999;  
idSparse = SparseArray[{{1, 1} -> num, {100000000, 10} -> num}];  

Look for RAM usage.

ByteCount[idSparse] 
976 

Export it to a file

Export["idSparse.rsa", idSparse];  

See the disk usage.

FileByteCount["idSparse.rsa"]  
205000360

Is it OK like that?
Two elements only occupied. For file usage is very high compared with RAM usage.

corey979
  • 23,947
  • 7
  • 58
  • 101
  • I can't reproduce your observations: as one would wish and expect, the file seems to be the same (small) size no matter how large the array nominally is. I tried in version 9.0.1. Which version are you using? – Oleksandr R. May 19 '13 at 01:42
  • The two numbers 976 and 205000360 are mixed up. . .Sorry. . .So file size is small and RAM usage is large. – Hp Radojewski Schäfer Von May 20 '13 at 12:06
  • There is definitely something strange here, and the memory usage is much higher in version 9 than in previous versions. This would be a good question if you would edit it to focus on the memory usage rather than the file size. When you do so, you'll have my upvote. – Oleksandr R. May 21 '13 at 01:49

0 Answers0