This question already has an answer here:

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.


Export it to a file

Export["idSparse.rsa", idSparse];  

See the disk usage.


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


marked as duplicate by Oleksandr R., whuber, Yves Klett, Sjoerd C. de Vries, rm -rf May 22 '13 at 15:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ 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? $\endgroup$ – Oleksandr R. May 19 '13 at 1:42
  • $\begingroup$ The two numbers 976 and 205000360 are mixed up. . .Sorry. . .So file size is small and RAM usage is large. $\endgroup$ – Hp Radojewski Schäfer Von May 20 '13 at 12:06
  • $\begingroup$ 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. $\endgroup$ – Oleksandr R. May 21 '13 at 1:49

Browse other questions tagged or ask your own question.