Re: general performance question
- From: "Mike Schilling" <mscottschilling@xxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 21:49:58 GMT
"Knute Johnson" <nospam@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:47a1c80f$0$31474$b9f67a60@xxxxxxxxxxxxxxxxxxxxx
Lasse Reichstein Nielsen wrote:
Knute Johnson <nospam@xxxxxxxxxxxxxxxxxxxxxxx> writes:
Mike Schilling wrote:...
if (condition)
{
LargeObject lg = new LargeObject();
lg.doStuff()
// See discussion below
}
I don't think that is true. If you create an Object in a loop and
then reassign another Object to the same reference in the loop, the
first Object is eligible for garbage collection (and will be).
The previous poster didn't mention loops, merely a nested block
scope.
For a loop, the value set in the last iteration also leaks the
block.
/L
How can it if the reference is created in the block?
The method's stack frame isn't collected until the method exits; it has no
notion of block scope.
.
- References:
- general performance question
- From: Tobi
- Re: general performance question
- From: Matt Humphrey
- Re: general performance question
- From: Mike Schilling
- Re: general performance question
- From: Knute Johnson
- Re: general performance question
- From: Lasse Reichstein Nielsen
- Re: general performance question
- From: Knute Johnson
- general performance question
- Prev by Date: Re: Extracting substring with regexp
- Previous by thread: Re: general performance question
- Next by thread: Re: general performance question
- Index(es):
Relevant Pages
|