Performance issues using H2 DB in embedded mode with heavy load of data in database

前端 未结 1 1490
梦谈多话
梦谈多话 2021-02-02 03:41

I am working a java application using H2 Database in embedded mode. My Application consumes 150mb of heap memory.

Problem: Steps When I load H2 database with 2 mb of dat

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-02 03:51

    In most cases, performance problems are not actually related to the cache size or page size. To analyze performance problems, see the H2 documentation, specially:

    • Database Performance Tuning
    • Using the Built-In Profiler
    • Application Profiling
    • Database Profiling
    • Statement Execution Plans
    • How Data is Stored and How Indexes Work

    If you set the cache size manually to 1024 * 1024, then H2 will use 1 GB heap memory. This setting should only be use if you have a lot more than 1 GB of physical memory available to the JVM (using java -Xmx2048m or similar). Otherwise, I suggest to use the default settings (16 MB cache size) instead.

    Using a smaller page size than the default might decrease performance. This depends on the hard disk, and possibly on the access pattern. However, there is no list of rules when to use a non-default page size - the only way to find out is to try different settings.

    0 讨论(0)
提交回复
热议问题