How can I stop MPLAB X from hanging between build and program?
Found this page and thought of sharing my experience. I searched on Google and found these two links:

http://microchip.wikidot.com/mplabx:jvm-configuration-options

https://performance.netbeans.org/howto/jvmswitches/index.html

These talk about tuning switches for the JVM so that Netbeans starts out well and uses a better GC, and Hotspot kicks in faster than it would normally. 

I did what they said in here and now MPLAB-X is much more snappy. I noticed that my CPU usage and RAM usage goes up initially when the application starts and parses all the open projects, but then it settles down to a comfortable level and IDE performs much better.

Your Mileage May Vary.