An exit status of 137 is 128 plus 9, meaning the process was terminated by SIGKILL. In a container or a systemd unit with a memory limit, the overwhelmingly common cause is the kernel out-of-memory killer acting on the cgroup, not on the whole machine, so free memory on the host can look healthy.
Confirm it rather than guessing. 'dmesg -T' or 'journalctl -k' contains a 'Memory cgroup out of memory: Killed process ...' line with the cgroup path and the RSS at the time. For Docker, 'docker inspect' reports OOMKilled true on the container state. Under cgroup v2, memory.events in the cgroup directory has an oom_kill counter.
The limit itself comes from MemoryMax in a systemd unit or from the runtime's memory flag for a container. Raising it is only correct if the workload's real footprint is higher than you thought; otherwise find the growth. Note that a JVM or Node process sizes its heap from the cgroup limit on modern runtimes, so shrinking the limit without adjusting the runtime's own settings can also produce the kill. 137 from a build step usually means the same thing on a memory-capped CI runner.