memory


memory, a C code 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
201,048,576
212,097,152
224,194,304
238,388,608
2416,777,216
2533,554,432
2667,108,864
27134,217,728
28268,435,456
29536,870,912
301,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.

Usage:

memory log_n_min log_n_max
runs the program for sizes N = 2log_n_min to 2log_n_max.

Licensing:

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

Languages:

memory is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

LINPACK_BENCH, a C code which measures the time needed to factor and solve a linear system.

MACHINE, a C code which can return various machine constants.

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

memory_test

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

TIMER, C codes which demonstrate how to compute CPU time or elapsed time.

Source Code:


Last revised on 31 July 2020.