Memory Size Calculator
Enter how many rows and columns of values you have, their data type and how many copies will be held at once. The calculator gives the memory used in binary and decimal units.
- Memory
- Bytes
- Smaller types
1 MiB is 1,048,576 bytes, the unit most programs report.
Memory = values × bytes per value. A table of 1 million rows by 10 columns of float64 holds 10 million values at 8 bytes each, 80 million bytes or 76.3 MiB. As float32 it would take half that.
Memory size chart
1 million values. Search for a type.
| Type | Bytes each | 1 million values | 100 million values |
|---|---|---|---|
| int8 | 1 | 0.95 MiB | 0.09 GiB |
| int16 | 2 | 1.91 MiB | 0.19 GiB |
| int32 | 4 | 3.81 MiB | 0.37 GiB |
| float32 | 4 | 3.81 MiB | 0.37 GiB |
| int64 | 8 | 7.63 MiB | 0.75 GiB |
| float64 | 8 | 7.63 MiB | 0.75 GiB |
| UUID | 16 | 15.26 MiB | 1.49 GiB |
| Python int in a list | 36 | 34.33 MiB | 3.35 GiB |
MiB.
Values and memory
float64. Slide the millions of values.
Each bar is one data type.
How to work out memory
Values to MiB. Step through it.
Count
Rows × columns.
Profile the real program to see overheads.
float64, float32 or int8
Data types. Compare them.
Default.
Half size.
Tiny.
Choosing the smallest safe type is the easiest way to save memory.
Before you load
Memory checks. Tick each item.
Tick each item as you go.
Load data in chunks if it will not fit.
What you get
Memory sizing. Each tile explains one result.
MiB or GiB.
Exact.
MB or GB.
Compared.
Compared.
Strings take far more memory than numbers in most languages.
Frequently Asked Questions
No question matches that search.
How much memory does an array use?
The number of values times the bytes for each value.
How big is a double precision float?
Eight bytes.
How much RAM do a million doubles need?
About seven point six MiB.
What is the difference between MB and MiB?
A MB is a million bytes, a MiB is one million and forty eight thousand five hundred and seventy six.
Why does Python use more memory?
Each number in a list is a separate object with its own overhead.
How can I cut memory use?
Use smaller data types and avoid extra copies.
Does a DataFrame add overhead?
Yes, a little for the index and column names.
Fit your data in memory
Know how much RAM your arrays need before you run out halfway through a job.
More size calculators
Each one has its own calculator, worked examples and answers to common questions.