How Big Can Arrays Be?

**MEMORY_TEST**
is a MATLAB program which
declares and uses a sequence of larger and larger arrays,
to see what the memory limits are on a given computer.

The program tries an increasing series of values of **N**, using
powers of 2, between limits that you set. At some point, the program
may ask for more memory than can be provided, and crash. This is one
way to find out what the memory ceiling is! The relevant power of 2
is likely to be in the 20's:

Log(N) | N |
---|---|

20 | 1,048,576 |

21 | 2,097,152 |

22 | 4,194,304 |

23 | 8,388,608 |

24 | 16,777,216 |

25 | 33,554,432 |

26 | 67,108,864 |

27 | 134,217,728 |

28 | 268,435,456 |

29 | 536,870,912 |

30 | 1,073,741,824 |

Remember that your memory is probably described in terms of bytes, but that integers and reals require 4 bytes, and double precision reals require 8 bytes.

runs the program for sizesmemory_test(log_n_min,log_n_max)

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

**MEMORY_TEST** is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version.

LINPACK_BENCH, a MATLAB program which measures the time needed to factor and solve a linear system.

MACHINE, a MATLAB library which can return various machine constants.

MATMUL, a FORTRAN90 program which is an interactive matrix multiplication benchmark program.

MDBNCH, a FORTRAN77 program which is a benchmark code for a molecular dynamics calculation.

SUM_MILLION, a MATLAB program which sums the integers from 1 to 1,000,000, as a demonstration of how to rate a computer's speed;

TIMER, a MATLAB program which demonstrates how to compute CPU time or elapsed time.

- memory_test.m, the source code.

- memory_test_output_g5.txt, a run of the program on a Mac, up to LOG(N) = 26.
- memory_test_output_pc.txt, a run of the program on a PC, up to LOG(N) = 25.

You can go up one level to the MATLAB source codes.