You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Marcus Crafter <cr...@fztig938.bank.dresdner.net> on 2001/08/23 21:33:37 UTC

[C2 diff] mru store gc logging

Hi All,

	Attached is a simple patch adding some logging before and after the
	garbage collector is invoked in the MRUMemoryStore. Hopefully this can
	give us some indication as to how much has been freed, and what is
	available.

	Diff is against the cocoon_20_branch ? (is this ok, or should it
	really be against trunk ?)
	
	Cheers,

	Marcus

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : Marcus.Crafter@osa.de
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:

AW: [C2 diff] mru store gc logging

Posted by Gerhard Froehlich <g-...@gmx.de>.
ok,
1. alghorithm now:
amount of memory used is greater then heapsize
run finalization of objects
run the garbage collector
while free memory is lower then the freememory constant
  free the cache

2. your proposal:
amount of memory used is greater then heapsize
while free memory is lower then the freememory constant
  free the cache
run finalization of objects
run the garbage collector

The 1. approach first gc() the already dereferenced objects.
This has the effect, that the Runtime.freeMemory() value is low
and the loop don't executes so often.

The 2. approach does first loop the cache with a greater
Runtime.freeMemory() value and the runs the gc(). The Loop
would take longer. This method is synchronized and I think
that can be a performance issue then.

That are my thoughts. I prefer the 1. approach.

Cheers
Gerhard
>-----Ursprungliche Nachricht-----
>Von: Marcus Crafter [mailto:crafterm@fztig938.bank.dresdner.net]
>Gesendet: Friday, August 24, 2001 5:01 PM
>An: cocoon-dev@xml.apache.org
>Betreff: RE: [C2 diff] mru store gc logging
>
>
>Hi Vadim,
>
>On Thu, 23 Aug 2001, Vadim Gritsenko wrote:
>
>> BTW, what do you think about while() loop just below debug() statement?
>> It looks to me then when this situation arises there are chances 
>that storage 
>> whould be empty before GC would be kicked again...
>
>	Seems to me like the while loop should be done before garbage
>	collection, as the loop just frees up memory, which will need to be
>	gc'd anyway. (What do you think Gerhard ?)
>
>	Cheers,
>
>	Marcus
>
>-- 
>        .....
>     ,,$$$$$$$$$,      Marcus Crafter
>    ;$'      '$$$$:    Computer Systems Engineer
>    $:         $$$$:   Open Software Associates GmbH
>     $       o_)$$$:   82-84 Mainzer Landstrasse
>     ;$,    _/\ &&:'   60327 Frankfurt Germany
>       '     /( &&&
>           \_&&&&'     Email : Marcus.Crafter@osa.de
>          &&&&.        Business Hours : +49 69 9757 200
>    &&&&&&&:
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


AW: [C2 diff] mru store gc logging

Posted by Gerhard Froehlich <g-...@gmx.de>.
>> -----Original Message-----
>> From: Marcus Crafter [mailto:crafterm@fztig938.bank.dresdner.net]
>> Sent: Friday, August 24, 2001 11:01 AM
>> To: cocoon-dev@xml.apache.org
>> Subject: RE: [C2 diff] mru store gc logging
>>
>>
>> Hi Vadim,
>>
>> On Thu, 23 Aug 2001, Vadim Gritsenko wrote:
>>
>> > BTW, what do you think about while() loop just below debug() statement?
>> > It looks to me then when this situation arises there are
>chances that storage
>> > whould be empty before GC would be kicked again...
>>
>> 	Seems to me like the while loop should be done before garbage
>> 	collection, as the loop just frees up memory, which will need to be
>> 	gc'd anyway. (What do you think Gerhard ?)
>
>My point here is that I am afraid that when loop is executed, it
>ALWAYS frees ALL objects from
>the cache, because freeMemory() is not changing as no GC is being
>done during loop execution.
>
>I might be not right here - I'm speaking theoretically - need to
>proof this point by experimenting.
>Additional debug() after loop with cache.size() printout would help.
In my test the cache wasn't freed totally. Most of the time he removed one
or two objects and exits the loop. but a debug statement at this point
would not be bad.

Greets from vienna
Gerhard


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [C2 diff] mru store gc logging

Posted by Vadim Gritsenko <vg...@hns.com>.
> -----Original Message-----
> From: Marcus Crafter [mailto:crafterm@fztig938.bank.dresdner.net]
> Sent: Friday, August 24, 2001 11:01 AM
> To: cocoon-dev@xml.apache.org
> Subject: RE: [C2 diff] mru store gc logging
> 
> 
> Hi Vadim,
> 
> On Thu, 23 Aug 2001, Vadim Gritsenko wrote:
> 
> > BTW, what do you think about while() loop just below debug() statement?
> > It looks to me then when this situation arises there are chances that storage 
> > whould be empty before GC would be kicked again...
> 
> 	Seems to me like the while loop should be done before garbage
> 	collection, as the loop just frees up memory, which will need to be
> 	gc'd anyway. (What do you think Gerhard ?)

My point here is that I am afraid that when loop is executed, it ALWAYS frees ALL objects from
the cache, because freeMemory() is not changing as no GC is being done during loop execution.

I might be not right here - I'm speaking theoretically - need to proof this point by experimenting.
Additional debug() after loop with cache.size() printout would help.

Vadim

> 
> 	Cheers,
> 
> 	Marcus
> 
> -- 
>         .....
>      ,,$$$$$$$$$,      Marcus Crafter
>     ;$'      '$$$$:    Computer Systems Engineer
>     $:         $$$$:   Open Software Associates GmbH
>      $       o_)$$$:   82-84 Mainzer Landstrasse
>      ;$,    _/\ &&:'   60327 Frankfurt Germany
>        '     /( &&&
>            \_&&&&'     Email : Marcus.Crafter@osa.de
>           &&&&.        Business Hours : +49 69 9757 200
>     &&&&&&&:
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [C2 diff] mru store gc logging

Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi Vadim,

On Thu, 23 Aug 2001, Vadim Gritsenko wrote:

> BTW, what do you think about while() loop just below debug() statement?
> It looks to me then when this situation arises there are chances that storage 
> whould be empty before GC would be kicked again...

	Seems to me like the while loop should be done before garbage
	collection, as the loop just frees up memory, which will need to be
	gc'd anyway. (What do you think Gerhard ?)

	Cheers,

	Marcus

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : Marcus.Crafter@osa.de
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [C2 diff] mru store gc logging

Posted by Vadim Gritsenko <vg...@yahoo.com>.
Thanks, applied.

BTW, what do you think about while() loop just below debug() statement?
It looks to me then when this situation arises there are chances that storage 
whould be empty before GC would be kicked again...
Do you want to look into this?

Vadim

> -----Original Message-----
> From: Marcus Crafter [mailto:crafterm@fztig938.bank.dresdner.net]
> Sent: Thursday, August 23, 2001 3:34 PM
> To: Cocoon Developers Mailing List
> Subject: [C2 diff] mru store gc logging
> 
> 
> Hi All,
> 
> 	Attached is a simple patch adding some logging before and after the
> 	garbage collector is invoked in the MRUMemoryStore. Hopefully this can
> 	give us some indication as to how much has been freed, and what is
> 	available.
> 
> 	Diff is against the cocoon_20_branch ? (is this ok, or should it
> 	really be against trunk ?)
> 	
> 	Cheers,
> 
> 	Marcus
> 
> -- 
>         .....
>      ,,$$$$$$$$$,      Marcus Crafter
>     ;$'      '$$$$:    Computer Systems Engineer
>     $:         $$$$:   Open Software Associates GmbH
>      $       o_)$$$:   82-84 Mainzer Landstrasse
>      ;$,    _/\ &&:'   60327 Frankfurt Germany
>        '     /( &&&
>            \_&&&&'     Email : Marcus.Crafter@osa.de
>           &&&&.        Business Hours : +49 69 9757 200
>     &&&&&&&:
> 

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org