correctly monitoring memory for processes that fork