Detect and pause process work until its memory goes down

Hello,
have you already looked at GenStage?
If I understand well, you are looking for some form of backpressure.
Hth.