adding monitoring of the memory usage