Hmm, yes, I could improve error reporting here by having the main memory allocation function set a global variable when it fails; then the function that actually prints the "Out of memory" error could check if that variable is nonzero and print it if so; this should work at least ~70% of the time. I'll do this within the next few days.
Meanwhile, my first guess as to the cause is a very long variant ID. PLINK 1.9 uses a rectangular [variant count] * [maximum variant ID string length + 1] array to store the IDs; this breaks down when very long indels are present and used in the variant IDs. I've run into this problem, anyway, and have changed the 2.0 variant ID data structure accordingly.