I am running a python program that processes a large dataset. Sometimes, it runs into a MemoryError
when the machine runs out of memory.
I would like any MemoryError that is going to occur to happen at the start of execution, not in the middle. That is, the program should fail-fast: if the machine will not have enough memory to run to completion, the program should fail as soon as possible.
Is it possible for Python to pre-allocate space on the heap?