Recently I'm trying creating a 80000 x 80000 sparse array in Mathematica, and I discovered a strange thing when using SparseArray[]
.
Code: s = SparseArray[{{1, 1} -> 1}, {80000, 80000}]
When I run this code in Wolfram Documentation window (find an example randomly, and replace it with this code, then run), the memory usage of WolframKernel
almost remains the same. However, when I run that code in Notebook window, WolframKernel
's memory usage increases greatly up to ~40 GB, and when that happens, other variables in this Notebook are erased.
I'm wondering what's the difference between the two environment, and is a 80000 x 80000 sparse array in Mathematica, with few specified elements, really takes up to over 1GB?
The version of Mathematica is 11.2.0.0, and the OS is macOS 10.13.4.
SparseArray
. I'm not expert in this but try looking at discussion under this thread. $\endgroup$