Low CPU usage when performing big task in java [closed]

Solution 1:

Is the console output slowing the application? Does the app use System.out or a logging framework like log4j?

I just solved a similar issue for a Java app and the behavior occurred after an update - the MySQL slow query log showed that the insert was taking 1 second but in reality a batch insert was being split into 1000 some inserts after the default behavior in the JDBC driver changed from auto commit being off for batch commits to having it on (which required me to manually turn off auto commits for batch inserts).