LGVL + MPLAB X + XC4.10 = Very big size code

I created a test project in MPLAB X for the PIC32MX795L controller and included the files from the src folder. There are no LGVL calls in my main code yet. But when compiling, the size of the compiled code exceeds 512K! What can I do to reduce the size of the code?

You need to enable dead code elimination (or an equivalent feature) in your linker. Right now it sounds like it’s leaving in unused code, which is why your binary is so large.