Error message regarding main memory

Hi all, I am encountering this error message again.

Error: comment.sty:19523: TeX capacity exceeded, sorry [main memory size=5000000].

The problem is that the program was working just fine (using Markdown, knitr, and LaTeX). I literally made no changes to the document and this is now the message I am getting.

I know that a reproducible example would be appreciated, but it is a 300 page book.

Any thoughts would be appreciated.

Thanks

dkaplan

This is coming from the LaTeX toolchain. See this S/O post how to fix on Debian.

Thank you, but this is not a Debian machine. It's a Mac running Catalina.

Similar for macOS