db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suresh Thalamati <suresh.thalam...@gmail.com>
Subject Re: Memory allocation problem
Date Fri, 19 Aug 2005 01:42:30 GMT
Hi Amit,

If you are just closing the connections, some of the memory used by
the database internal structures will not be released,for example 
memory used by the page cache will not be released; default size of 
cache is 1000 pages, if cache is full, it can take up 32MB if all 
pages are 32K or  4MB if page size is 4K.

If you really want to release all the memory used by a derby database 
then you need to shutdown the database. If you are frequently 
connecting back to the database,  shutting down the database is not a
good idea. It will impact the performance of u'r application .
First Connection that comes after the shutdown will
need to boot the database and also , it will need to reread the
data from the disk into the cache if your application is reading the 
same data that was in the cache before the shutdown.


Amit Modi wrote:
> Hello,
>  I am using derby for my desktop application. We have our complete 
> application in java and
> one problem which we are facing is, after doing login and logout 
> operation for five to six time
> it shows out of memory exception. When I used some profiler, I found out 
> that the maximum memory is getting
> used in execute() method of derby. Though after each logout I close the 
> database and before closing it I close all the statements and
> PreparedStatements create during the login.
> I think there are live pointer remaining after the database get closed 
> pointing to some raw data and result sets.
> Can anyone please let me know whatz the best practice to make all the 
> pointer point to null, created internally to database.
> Thanks in Advance.
> Regards:
> Amit Modi

View raw message