If you're running both (Java+MySQL server), MySQL would consume it faster, but you have greater control over it's garbage collection (query cache, tables in memory, etc), whereas JVM would develop memory leaks and eventually over take MySQL and likely never go back down until you restarted the...