I want to write a general exception handler to
warn if too much data is being loaded for the ram size in a machine for a
successful numpy array operation to take place. For example, the program
multiplies two floating point arrays A and B which are populated with
loadtext. While the data is being loaded, want to continuously check that
the data volume doesn't pass a threshold that will cause on out-of-memory error
during the A*B operation. The known variables are the amount of memory
available, data type (floats in this case) and the numpy array operation to be
performed. It seems this requires knowledge of the internal memory requirements
of each numpy operation. For sake of simplicity, can ignore other memory
needs of program. Is this possible?