Some friendly advice to make your programming and your scripts/programs more efficient ...

To check cpu and memory usage of active jobs on a server use the command 'top':
    top

To only see your jobs add:
    top -u ${USER}

By default, 'top' sorts all jobs by cpu usage. To sort them by memory usage just type 'M' (capital 'm') once 'top' is open.
To quit 'top' just press 'q'.