db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Modi <amit_m...@persistent.co.in>
Subject Re: Memory allocation problem
Date Fri, 19 Aug 2005 05:29:07 GMT
Thanks Suresh for reply,
    Actually I have different Database for each user and if the user do 
continuous "change user login" operation though its
not very usual case in real life but for testing purpose, then its 
necessary to close the database of  previous user and  open the database
of new user.
  One problem which I am facing is, after I shutdown the previous user's 
database, its not releasing the  complete memory.
 I will just give you brief description of the steps I am following to 
close the database,
1> Close all the statements and prepared statements.
2> Shutdown the database

Can you please let me know, whether there should be something more that 
I should do?

Amit Modi

Suresh Thalamati wrote:

> 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.
> Thanks
> -suresht
> 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