It sounds like your app container size is too small for your use-case.
If you want assistance with debugging the mendix-agent pod, share it's k8s events which should state what happened to it. It's very strange the mendix-agent pod gets terminated and not returning due to your app pod consuming too much resources.