You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Alexandru Popescu <th...@gmail.com> on 2005/12/10 03:28:29 UTC

BindableRepository profiling and suggested patch

Hi!

I've been profiling an application using Jackrabbit by means of BindableRepository. I have noticed 
that on consequetive redeployments a lot of memory is not freed (check the attached picture).
As you can notice a lot of this space is used by java.lang.Shutdown which keeps the shutdown hooks.

The application has context listeners that are correctly unregistering the BindableRepository (using 
RegistryHelper).

My proposed patch is the following:

1/ keep the shutdown hook thread in the BindableRepository after init is called;
2/ if the BindableRepository.shutdown is correctly called by means of RegistryHelper than remove the 
shutdown hook

Attached is also the patch generated upon BindableRepository v.307128.


What is your opinion on this?

./alex
--
.w( the_mindstorm )p.




Re: BindableRepository profiling and suggested patch

Posted by Alexandru Popescu <th...@gmail.com>.
#: Marcel Reutegger changed the world a bit at a time by saying on  12/14/2005 10:13 AM :#
> Alexandru Popescu wrote:
>>> thanks for the suggestion. makes sense to me.
>>>
>>> +1
>>>
>> 
>> Any news about it?
> 
> since none objected, I committed the patch, with some modifications 
> though: added a try catch around the removeShutdownHook() for the case 
> when the shutdown hook itself shuts down the repository. in that case
> removeShutdownHook will throw an IllegalStateException because the jvm 
> is in the process of shutting down.
> 
> thanks alex.
> 
> svn revision: 356747
> 
> regards
>   marcel
> 

Great! Thanks Marcel! I haven't been able to get the IllegalStateException, even if I would have 
been expecting it (exactly as you are saying). However, it is better to have that piece in place.

cheers,

./alex
--
.w( the_mindstorm )p.


Re: BindableRepository profiling and suggested patch

Posted by Marcel Reutegger <ma...@gmx.net>.
Alexandru Popescu wrote:
>> thanks for the suggestion. makes sense to me.
>>
>> +1
>>
> 
> Any news about it?

since none objected, I committed the patch, with some modifications 
though: added a try catch around the removeShutdownHook() for the case 
when the shutdown hook itself shuts down the repository. in that case
removeShutdownHook will throw an IllegalStateException because the jvm 
is in the process of shutting down.

thanks alex.

svn revision: 356747

regards
  marcel

Re: BindableRepository profiling and suggested patch

Posted by Alexandru Popescu <th...@gmail.com>.
#: Marcel Reutegger changed the world a bit at a time by saying on  12/12/2005 11:19 AM :#
> Hi Alex,
> 
> thanks for the suggestion. makes sense to me.
> 
> +1
> 
> regards
>   marcel
> 


Any news about it?

./alex
--
.w( the_mindstorm )p.

> Alexandru Popescu wrote:
>> Hi!
>> 
>> I've been profiling an application using Jackrabbit by means of 
>> BindableRepository. I have noticed that on consequetive redeployments a 
>> lot of memory is not freed (check the attached picture).
>> As you can notice a lot of this space is used by java.lang.Shutdown 
>> which keeps the shutdown hooks.
>> 
>> The application has context listeners that are correctly unregistering 
>> the BindableRepository (using RegistryHelper).
>> 
>> My proposed patch is the following:
>> 
>> 1/ keep the shutdown hook thread in the BindableRepository after init is 
>> called;
>> 2/ if the BindableRepository.shutdown is correctly called by means of 
>> RegistryHelper than remove the shutdown hook
>> 
>> Attached is also the patch generated upon BindableRepository v.307128.
>> 
>> 
>> What is your opinion on this?
>> 
>> ./alex
>> -- 
>> .w( the_mindstorm )p.
>> 
>> 
>> 
> 
> 


Re: BindableRepository profiling and suggested patch

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Alex,

thanks for the suggestion. makes sense to me.

+1

regards
  marcel

Alexandru Popescu wrote:
> Hi!
> 
> I've been profiling an application using Jackrabbit by means of 
> BindableRepository. I have noticed that on consequetive redeployments a 
> lot of memory is not freed (check the attached picture).
> As you can notice a lot of this space is used by java.lang.Shutdown 
> which keeps the shutdown hooks.
> 
> The application has context listeners that are correctly unregistering 
> the BindableRepository (using RegistryHelper).
> 
> My proposed patch is the following:
> 
> 1/ keep the shutdown hook thread in the BindableRepository after init is 
> called;
> 2/ if the BindableRepository.shutdown is correctly called by means of 
> RegistryHelper than remove the shutdown hook
> 
> Attached is also the patch generated upon BindableRepository v.307128.
> 
> 
> What is your opinion on this?
> 
> ./alex
> -- 
> .w( the_mindstorm )p.
> 
> 
>