I have this peculiar problem with running a Processing application in IntelliJ IDEA. I want to save a large image and to do this I run in to the following exception:
IntelliJ shows you the amount used and the current size of the heap. You are trying to set the maximum which it does not show.
You can attach VisualVM to IntellIJ to see the maximum by running jvisualvm
Changing vmoptions file adjusts the memory used by IntelliJ, but what you're having here is a shortage of memory of JRE that is launched by IntelliJ to execute your application. You need to adjust the memory setting in VM options part of the Run/Debug configuration, for example: