Detect and pause process work until its memory goes down

I see, having no real-world experience with this kind of problem I’m probably misunderstanding it, but searching a while I found a ‘solved’ thread in the forum where a memory issue was accounted with GenStage (edit: actually the subject was Flow): […] memory was growing quite fast to more than 1gb, I ctrl+ced to not exhaust my RAM".
Maybe that is an indirect way to keep memory under control? Sorry if getting it wrong.