db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Kam" <moonblade.w...@gmail.com>
Subject Derby Memory Issues in CDC
Date Thu, 19 Jun 2008 03:36:56 GMT
Hello all,

I'm currently developing on CDC 1.0, using Creme JVM, running on HP iPAQ
6965 pocket pc device.
I'm using Apache Derby as the embedded database for the application.

I notice that the Java app has only about 29MB of memory available, as the
rest has been consumed
by the OS or other things.

Although the RAM is 64MB, when i click on the Start -> Setting -> Memory,
it says only 48MB memory available, not sure why.

Anyway this means, i gotta know how much memory Apache Derby consumes.
Here's the Derby version i'm using : derby-
Here's my minimum derby.properties configuration :

Fortunately i can use Creme monitoring tool to monitor the memory usage at
real time.
I notice that if i start a simple program, just a simple System.out.println,
and then the program
goes to sleep for around 10 secs, i notice the memory used is around 850KB.

Then i tried running a select statement using Apache Derby embedded
database, and then goes
to sleep for around 10 secs, i notice the memory usage is around 10MB ..
After this, i modify the source to select from around 7 tables, and i notice
the memory usage is stable
around 12MB .. I tried looping this process for around 40 times, and it's
still stable around 12 MB

I try with another program that issues delete for all those 7 tables, and
the memory usage is around 15MB.
All these tests are conducted without any GUI or any other things that could
consume large memory usage.
All these tests also use plain Statement, as i was concerned about
PreparedStatement that could increase the
memory consume as they're cached by the Derby. I think, slower is better
rather than not be able to run at all
because of memory limitation.

My temporary conclusion is this :
- The attempt to use embedded database for the first time will consume
around 9MB of memory
- The attempts to use the statement (insert, update, select, delete) for the
first time increase the memory usage too.
I dont know if setting the pageSize and pageCacheSize has any effects on
this point.

If my conclusion is temporary correct, then the memory usage goes up along
with the number of tables i'll operate on,
and this is very limiting.

Is there anyway i could limit memory usage ?

Please help ..

Albert Kam

View raw message