Compile time OutOfMemoryError

I have a sketch that is quite big (about 8 MiB) that will not compile. When I run it, it gives me an OutOfMemoryError while compiling. It will not even do print("hi"); if I put it at the beginning. Does anyone know how I might prevent this from happening? I tried increasing the maximum memory to 4 GiB, but it still doesn’t work and Processing 4 is only using 700 MiB total. I am very confused.