How does Excel, with a few relatively big 5MB spreadsheets open, use 2GB of RAM? Isn’t all the data it’ll ever need to process hundreds of times less than that?

257 views

How does Excel, with a few relatively big 5MB spreadsheets open, use 2GB of RAM? Isn’t all the data it’ll ever need to process hundreds of times less than that?

In: 23

4 Answers

Anonymous 0 Comments

First consider that if 5MB is the size on disk, that’s the compressed size. In order to actually work with the spreadsheet in memory it’s going to be uncompressed and that might take a lot more space.

If there are a lot of formulas, it needs to build up data structures to keep track of exactly what cells need updating if each cell changes.

If there are scripts, it’s running a JIT compiler, I believe – that explodes the size of code to many times its size.

There’s also the display. Your monitor might display several million pixels, it could easily take 10+ MB for the uncompressed bitmap of the visible pixels on screen, and it could be buffering additional pixels so that you can scroll very quickly without redrawing.

Charts, etc. add to that.

In the end, what it comes down to is that all of that RAM is being used for something, usually to make working with that spreadsheet faster and more responsive.

Yes, Microsoft could write it to be more efficient and use less RAM, but doing so naively would mean a speed tradeoff.

I’m sure Excel does worry about RAM usage. But with every new computer shipping with 8 – 16 GB of RAM these days, there’s no reason to worry about 2 GB if it really is multiple large spreadsheets. They’re going to be far more worried about someone running out of RAM on a lower-end machine with a smaller spreadsheet – that’d be bad.

Keep in mind, there’s no point in not using RAM. Your machine doesn’t run faster if you use less than your available RAM. It makes sense for apps to use as much as they need, until you run out.

Anonymous 0 Comments

2 GB is typically the limit that [32-bit apps](https://en.wikipedia.org/wiki/2_GB_limit) will have, and quite a number of programs and apps just outright reserve that amount when they start up.

Windows (or any operating system) can “manage” that, and on computers or devices that don’t have a lot of memory, it can pretend “here’s your 2 GB” but actually only 100 MB are in memory, the rest are on the disk as “cache” or as a temporary working file. If your system has plenty of memory though, it’s not a big deal to give the app or program access to the entire 2 GB it requested. RAM, after all, is just “working space”, like a whiteboard.

Anonymous 0 Comments

like you can’t remember everything. so you look things up from time to time. if you know it, then the response is fast bc it’s in your head. if you don’t know it, you look it up somewhere and thus it’s slower. computers are the same way

Anonymous 0 Comments

This is super ELI5 but maybe it will help. Think of the space that it takes up as being actual volume. The 5MB in the hard drive is like the flat pack that you just bough from IKEA, when Excel loads it up, it follows all the instructions and puts that flat pack together and in the end, you have a few parts left over but can’t believe that the whole thing fit in that small box.