When Do a Query,Cpu Used 800%

I Use Metabase for a long time ,but recently,metabase always use all my cpu resource and get stuck when i run a query,here is the error log when metabase not stuck.I really need help!

10-16 07:24:07 INFO middleware.cache :: Using query processor cache backend: :db 
Exception in thread “Timer-1” java.lang.OutOfMemoryError: GC overhead limit exceeded
Exception in thread “MVStore background writer nio:/home/chengxs/metabase.db.mv.db” java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOf(Arrays.java:3236)
at sun.misc.IOUtils.readFully(IOUtils.java:60)
at java.util.jar.JarFile.getBytes(JarFile.java:425)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:981)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:450)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.h2.mvstore.ConcurrentArrayList.iterator(ConcurrentArrayList.java:95)
at org.h2.mvstore.MVMap.openVersion(MVMap.java:1135)
at org.h2.mvstore.MVStore.storeNowTry(MVStore.java:1130)
at org.h2.mvstore.MVStore.storeNow(MVStore.java:1050)
at org.h2.mvstore.MVStore.commitAndSave(MVStore.java:1039)
at org.h2.mvstore.MVStore.writeInBackground(MVStore.java:2489)
at org.h2.mvstore.MVStore$BackgroundWriterThread.run(MVStore.java:2720)
10-16 07:30:47 WARN metabase.query-processor :: Query failure: Java heap space
[]

10-16 07:30:47 DEBUG metabase.middleware :: POST /api/card/98/query 200 (3 mins) (5 DB calls)
10-16 07:30:48 WARN metabase.query-processor :: {:status :failed,
:class clojure.lang.ExceptionInfo,
:error “Rollback failed handling “Communications link failure during rollback(). Transaction resolution unknown.””,
:stacktrace
[“driver.generic_sql.query_processor$do_in_transaction.invokeStatic(query_processor.clj:469)”
“driver.generic_sql.query_processor$do_in_transaction.invoke(query_processor.clj:468)”
“driver.generic_sql.query_processor$run_query_without_timezone.invokeStatic(query_processor.clj:483)”
“driver.generic_sql.query_processor$run_query_without_timezone.invoke(query_processor.clj:482)”
“driver.generic_sql.query_processor$execute_query$fn__48549.invoke(query_processor.clj:505)”
“driver.generic_sql.query_processor$do_with_try_catch.invokeStatic(query_processor.clj:449)”
“driver.generic_sql.query_processor$do_with_try_catch.invoke(query_processor.clj:448)”
“driver.generic_sql.query_processor$execute_query.invokeStatic(query_processor.clj:502)”

How do you start your metabase?
Can you increase jvm memory max and minimum?

First of all, thx for reply!
I start metabase with this cmd : “java -jar metabase.jar &”.my mechine got 8 threads cpu,so i think 800% is all i have,and mem is 16G.
Now,my metabase is work fine,so i think this error not appear everytime.may it happen when it just start or do concurrency query?

Could it be happening when Metabase is scanning the database? Try selecting ‘Re-scan field values now’ in the database settings to see if you can trigger the high use.
If it does, then change the database’s settings to manual sync only.

looks like i can trigger this setting.
10-17 09:10:15 INFO sync.util :: STARTING: Sync metadata for mysql Database 2 ‘Stat’
10-17 09:10:15 INFO sync.util :: FINISHED: Sync metadata for mysql Database 2 ‘Stat’ (216 ms)
it works fine for a day,so i think,maybe Metabase is doing work when this high use happen.

Not the metadata, the field values:
image

Set it to either manual or when user adds new in the schedule settings:

i don’t find the option you show to me.i set this

That’s right. then click save and you’ll a scheduling tab appear at the top:
image

ok,i got this.thanks for the help.:+1: