I wrote a custom JOOQ generator to generate kotlin classes intead of Java classes.
The problem is, the database that I am generating code for has more than 500 tables.
I need to make some changes to this generator, so I will be compiling a lot of the code it produces for testing. Problem is: I keep getting "OutOfMemory" exceptions, even when allocating 2 or 3 GBs of memory.
I know that allocating more memory to the compiler is an option, but I will be adding more features to this code generator, so I speculate that the memory needed to compile the code that it produces will also grow considerably, potentially making it unusable in low end machines.
I would like to know if there is a more "budget friendly" alternative to this, if I can make the compiler consume less memory, even if the compile time increases.
Edit: As asked in the comments, I will clarify some things:
The code generation phase runs just fine and fast. The problem lies when compiling the code that was generated with the Kotlin compiler, after 3 to 4 minutes it will throw a OutOfMemoryError.