If you want to monitor what is happening while running a job on CircleCI you can do this using a background job that will run alongside your other jobs using background: true.
A job that has background: true set will run while there are other jobs running but once they have finished the background job will also end, it will not run on its own if there are no other jobs.
The following code will run as an infinite loop printing the text from the echo command every five seconds as a background job. Replacing the echo command will allow any command to run every 5 seconds. You can also set any job to run the background by adding the background: true to the end of the job as shown in the example below.
command: | while true; do sleep5 echo "this in running in the background" done background: true
Any job which is set with background: true will continue to run in the background while other jobs are running showing any output that you have defined.
The following link is specifically for recording memory usage using the background: true setting:
The following link is for the CircleCI documentation for background commands: