Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7683461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:47:58+00:00 2026-05-31T18:47:58+00:00

I am working a java application using H2 Database in embedded mode. My Application

  • 0

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 data, database access is fast and heap memory size 160mb.

But When I load H2 database with 30 mb of data(h2 db file size =30 mb). Then accessing the database from my application is very slow. the reason being my application heap size is hugely grown to 300mb of size hence degraded performance. I confirmed using JConsole.

So my understanding is since H2 database is developed using java and since I am using H2 database in embedded mode, the heap size of H2 Database is added to my application which is breaking the application.

The problem is as H2 database size is grown, the performance of my application is degraded.

How to resolve the issue?

I have given the connection as

 rurl = "jdbc:h2:file:/" + getDBPath() + dbname + ";CACHE_SIZE=" + (1024 * 1024) + ";PAGE_SIZE=512";

to increase the cache of H2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:47:59+00:00Added an answer on May 31, 2026 at 6:47 pm

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Java for a web application, and I'm working with a MySql database.
we are currently working on a new web application using Java and MySql. We
I'm working on a 3D graphical application in Java using the Java 3D API.
I have been developing a Java application using J2EE and a Derby database. My
In a Java web application I am working on, we are using OracleConnectionPoolDataSource for
I am working on the Java desktop application using Swing. As the application is
Problem Domain: I am working on a new revision of a Java application that
I am working on an application for java right now that will be using
i am working in a web application using java language.i have a requirement to
I'm working on a Java application that uses JavaSpace. We're developing this in Eclipse.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.