In order to set the heap size, use MPLab Harmony 3, click on System in the Project Graph, then open the tree as follows:
- Device & Project configuration
- Project configuration
- Tool Chain Selections
- XC32 Global Options
- Linker
- General
and set Heap Size (bytes) to the desired value.
Additionally, you need to set the heap size in the project options => XC32 options => xc32-ld options: