I have a fairly large a list of matrices matsLst, which takes about 15 minutes to compute (but computes successfully each time). I can test in the notebook that the computation has happened correctly.

But when I try to write it to disk using

Export["matsLst.mx", matsLst];

the command takes hours to run. The last time the export happened successfully, it took three hours. Right now, it's still going on two hours. I know that disk space should not be a problem, because I have about 40 GB available on my disk.

But is there a way for me to find out just how large a particular variable is before I choose to write it or not? (I mean, the whole point of writing an MX file is to save the computation time later.)


1 Answer 1


You could try ByteCount[expr]. According to the documentation it gives the number of bytes used internally to store the expression.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.