Unfortunately, there is no guarantee that the leaking process will be the next process to try to allocate memory after you run out. It might actually be your window manager, for example.
The OOM killer is a last-ditch attempt by the OS to keep running, but it is very likely to leave your system in an unstable state.
The author mentions that some of the changes broke things, but it’s a long way into the article before the word “test” appears. It’s only point 6/7 of his recommendations.
Making changes with no test coverage is not refactoring. It’s just rewriting. Start there.