Java is famously crappy and sluggish for GUIs too, and barely tolerable for web. As a rule of thumb, whatever you are running on your server will run about 20-30% faster if you recode it from Java to C++. First hand experience speaking here, and you will find multiple confirmations out there. Java is just a pig, with its jitting, memory hogging, heavyweight thread locks, etc, etc.
Mind you, Java performs better than Python or Ruby so at least there is that. But never labour under the illusion that Java can compete with C++ or C in terms of throughput, latency or memory footprint. You code in Java so you can use cheaper programmers, that's it. Otherwise, if you can afford it, you do the job properly in C++.