To get an idea of how much physical memory your application needs, you can use the wrapper command r_memusage. We advise you to start and then stop it with CRTL+C after some seconds, because for many applications most of the memory is allocated at the beginning of their run time. Alternatively, you may use the --kill option of r_memusage. You can round up the displayed memory peak value and use it as parameter to the batch system.
$ r_memusage hostname
memusage: peak usage: physical memory: 0.5 MB
For MPI applications you have to insert the wrapper just before the executable:
$ $MPIEXEC $FLAGS_MPI_BATCH r_memusage hostname
memusage: rank 0: peak usage: physical memory: 0.5 MB
memusage: rank 1: peak usage: physical memory: 0.5 MB
For a more detailed description of r_memusage use the following command: