You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Øyvind Harboe <oy...@zylin.com> on 2010/01/07 10:45:56 UTC

Derby memory consumption with many databases

Did I understand correctly that  derby.storage.pageCacheSize is configured
per database?

Is there a way to set the page cache size for derby across all databases in
the JVM when running Derby in embedded mode?

Background:

We are running Derby in an application where there is one database per client.

Eventually we would want to update the database model to allow all clients
to be inside a single database, but that is a big undertaking.

Derby offers a great solution for us. We use it in embedded mode and have
one database per client.

However, memory consumption is getting out of hand now that we're reaching
hundreds of databases.

After taking a heap snapshot and examining memory usage, it looks like it is
the page cache that is causing the problem.

At any one time there are only a few databases active, so if Derby had a concept
of configuring maximum cache usage for the entire JVM, there would not be
a problem with the available memory.

-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

AW: Derby memory consumption with many databases

Posted by Ma...@de.equens.com.
Hi to all who know more about Derby
In this particular situation mentioned below, is it possible
to work with views that are able to use the certain table of the 
particular schema of the user that is loged in.
It is just a thought that may be then the db abstraction layer Cayenne
provides still is able to work....(?)

-----Ursprüngliche Nachricht-----
Von: Øyvind Harboe [mailto:oyvind.harboe@zylin.com] 
Gesendet: Donnerstag, 7. Januar 2010 17:37
An: Derby Discussion
Betreff: Re: Derby memory consumption with many databases

> In case you go that route, I just thought I'd mention here that Derby
> supports standard SQL schemas and SQL authorization (so users would be
> protected from accessing each others schemas) in contrast to
> e.g. MySQL, for which database and schema is more or less the same
> thing.

The problem I have with schemas is that it isn't really portable between
databases...

We would like to leave the database choice to the users. Our app is
talking to Cayenne which provides the db abstraction.

-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

Re: Derby memory consumption with many databases

Posted by Øyvind Harboe <oy...@zylin.com>.
> In case you go that route, I just thought I'd mention here that Derby
> supports standard SQL schemas and SQL authorization (so users would be
> protected from accessing each others schemas) in contrast to
> e.g. MySQL, for which database and schema is more or less the same
> thing.

The problem I have with schemas is that it isn't really portable between
databases...

We would like to leave the database choice to the users. Our app is
talking to Cayenne which provides the db abstraction.

-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

Re: Derby memory consumption with many databases

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Øyvind Harboe <oy...@zylin.com> writes:

> Did I understand correctly that  derby.storage.pageCacheSize is configured
> per database?
>
> Is there a way to set the page cache size for derby across all databases in
> the JVM when running Derby in embedded mode?
>
> Background:
>
> We are running Derby in an application where there is one database per client.
>
> Eventually we would want to update the database model to allow all clients
> to be inside a single database, but that is a big undertaking.

In case you go that route, I just thought I'd mention here that Derby
supports standard SQL schemas and SQL authorization (so users would be
protected from accessing each others schemas) in contrast to
e.g. MySQL, for which database and schema is more or less the same
thing.

Dag

Re: Derby memory consumption with many databases

Posted by Øyvind Harboe <oy...@zylin.com>.
On Thu, Jan 7, 2010 at 4:03 PM, Bryan Pendleton
<bp...@amberpoint.com> wrote:
>> However, memory consumption is getting out of hand now that we're reaching
>> hundreds of databases.
>
> ...
>>
>> At any one time there are only a few databases active
>
> Is it possible that you aren't fully shutting each database down when you
> are through with it?

I'm never shutting down the databases for as long as the JVM(tomcat
server) lives.



-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

Re: Derby memory consumption with many databases

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> However, memory consumption is getting out of hand now that we're reaching
> hundreds of databases.
...
> At any one time there are only a few databases active

Is it possible that you aren't fully shutting each database down when you
are through with it?

thanks,

bryan