Re: H2 Memory Usage

515 views
Skip to first unread message

Thomas Mueller

unread,
Sep 23, 2012, 6:27:56 PM9/23/12
to h2-da...@googlegroups.com
Hi,

Well, it depends. I guess you are making a mistake, for example the application is using that much memory and not the database, or you have used in-memory tables. Without a reproducible test case it's hard to say what the problem is. I suggest you analyze what part is using the memory by analyzing a heap histogram or a heap dump using Eclipse MAT.

You can read about the expected memory usage for H2 here: http://h2database.com/html/grammar.html#set_cache_size

Regards,
Thomas

On Fri, Sep 21, 2012 at 6:04 PM, Gustavo De Micheli <neonate...@gmail.com> wrote:
Hi! I been using H2 for a production DB in file mode. The file of the DB is around 10Mb, but the memory usage is la 700Mb (this value I get from MEMORY_USED()).
Is this normal? Is there a way of reducing this memory usage?

I'm currenty embeding the db server in a tomcat with 1Gb of memory allocated, but when the H2 memory usage reaches 700Mb or so, the performance of the whole application declines.

Any solutions or ideas?

Thanks

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/5_v3B6y3M7MJ.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Gustavo De Micheli

unread,
Sep 25, 2012, 10:09:36 AM9/25/12
to h2-da...@googlegroups.com
Thanks Thomas, that's the next thing I going to do.
I'll publish the results when I'm able.

Gustavo

Gustavo De Micheli

unread,
Nov 8, 2012, 11:48:23 AM11/8/12
to h2-da...@googlegroups.com
Thomas, you were right. My app code was consuming that memory. After inspecting the heap dump I realize what was the problem and solved it.
I got confused by seeing that javamelody and the function of the db (MEMORY_USED()) returned that amount of memory. This is probably because the server is embeded and the heap memory is shared.

Thanks for the help again.
Reply all
Reply to author
Forward
0 new messages