Ask a Question related to ASP Components, Design and Development.
-
Rea #1
memory leak in script??
Hey eb
can this be the reason for huge memory expansion ?
Doesn't this script free memory of the object it had created?
sub createCOMobject()
set obj1 = createObject("object1")
dim flag = 1
useObject flag,obj1
end sub
----------------------------------
sub useObject (flag, byRef obj1)
....
set obj1 = Nothing
end sub
Thanks for your attention
Rea
Rea Guest
-
#39438 [NEW]: Memory leak PHP Fatal error: Out of memory
From: nikolas dot hagelstein at gmail dot com Operating system: NETBSD 3.0.1 AMD64 PHP version: 5.2.0 PHP Bug Type: ... -
memory problem/memory leak
Hi I have a problem with shockwave player running in Internet Explorer. My program consists of a controller movie which loads in content files in... -
Memory consumption of Ruby/mod_ruby combo on Apache [memory leak]
> I don't think so - I think all the modules are loaded when Apache is It didn't have anything to do with IfModules or even Apache. I had a... -
AIX 4.3.3 leak memory
I don't understand why, I have a program which leak memory on AIX 4.3.3 and not on others (AIX 4.3.3 or AIX 4.2 or Linux or SUN...). I try to use... -
Is this a memory leak???
Hi Nicholas So is there a way to release the file cache ?. We did another test using a AIX 4.3 box, to allocate some memory then read a large... -
Anthony Jones #2
Re: memory leak in script??
"Rea" <Rea@discussions.microsoft.com> wrote in message
news:953AB6C1-FF00-45ED-88B5-9BAF67CBF536@microsoft.com...Setting an object variable to nothing does not free memory.> Hey eb
> can this be the reason for huge memory expansion ?
> Doesn't this script free memory of the object it had created?
>
> sub createCOMobject()
> set obj1 = createObject("object1")
> dim flag = 1
> useObject flag,obj1
> end sub
> ----------------------------------
> sub useObject (flag, byRef obj1)
> ...
> set obj1 = Nothing
> end sub
>
> Thanks for your attention
> Rea
>
Assigning a new value (whatever it is not just nothing) to variable will
cause the release method of the any currently held reference to be called
before the reference is replaced by the new value.
Calling release on an interface reference (commonly known as an object
variable) causes the object to decrement an internally held count of the
number of references that have been made. When this count reaches zero then
it is the object's responsibility to deallocate any memory or other
resources it may be holding.
obj1 is passed byRef (the default mode in VBScript BTW) so the assigning of
Nothing to obj1 is applied to the variable of the same name in the
createCOMobject procedure. Since this is the only reference being held the
internal reference count of the object drops to zero and the object should
destroy itself at this point.
However without the line assigning nothing to the obj1 variable the obj1
variable is destroyed when the procedure createCOMobject returns, at this
point any reference currently held in obj1 has it's release method called.
Hence in this case the assignment of nothing is superflous.
HTH,
Anthony.
Anthony Jones Guest
-
Rea #3
Re: memory leak in script??
Thanks Anthony
I see your point.
But according to what you say, memory
should be released at the end of my script's execution..
while it clearly does not.
I follow memory consumption of my application,
and each time i run this script i see a growth in totall memory consumed by
it.
"Anthony Jones" wrote:
>
> "Rea" <Rea@discussions.microsoft.com> wrote in message
> news:953AB6C1-FF00-45ED-88B5-9BAF67CBF536@microsoft.com...>> > Hey eb
> > can this be the reason for huge memory expansion ?
> > Doesn't this script free memory of the object it had created?
> >
> > sub createCOMobject()
> > set obj1 = createObject("object1")
> > dim flag = 1
> > useObject flag,obj1
> > end sub
> > ----------------------------------
> > sub useObject (flag, byRef obj1)
> > ...
> > set obj1 = Nothing
> > end sub
> >
> > Thanks for your attention
> > Rea
> >
> Setting an object variable to nothing does not free memory.
>
> Assigning a new value (whatever it is not just nothing) to variable will
> cause the release method of the any currently held reference to be called
> before the reference is replaced by the new value.
>
> Calling release on an interface reference (commonly known as an object
> variable) causes the object to decrement an internally held count of the
> number of references that have been made. When this count reaches zero then
> it is the object's responsibility to deallocate any memory or other
> resources it may be holding.
>
> obj1 is passed byRef (the default mode in VBScript BTW) so the assigning of
> Nothing to obj1 is applied to the variable of the same name in the
> createCOMobject procedure. Since this is the only reference being held the
> internal reference count of the object drops to zero and the object should
> destroy itself at this point.
>
> However without the line assigning nothing to the obj1 variable the obj1
> variable is destroyed when the procedure createCOMobject returns, at this
> point any reference currently held in obj1 has it's release method called.
> Hence in this case the assignment of nothing is superflous.
>
> HTH,
>
> Anthony.
>
>
>
>Rea Guest
-
Anthony Jones #4
Re: memory leak in script??
"Rea" <Rea@discussions.microsoft.com> wrote in message
news:95D11CF1-AA93-45D4-9AD9-9A7E668B709D@microsoft.com...by> Thanks Anthony
> I see your point.
> But according to what you say, memory
> should be released at the end of my script's execution..
> while it clearly does not.
> I follow memory consumption of my application,
> and each time i run this script i see a growth in totall memory consumedThen the fault is either with the object itself what is it?> it.
Or code that you haven't yet shown us. Show us more code.
called>
>
> "Anthony Jones" wrote:
>> >
> > "Rea" <Rea@discussions.microsoft.com> wrote in message
> > news:953AB6C1-FF00-45ED-88B5-9BAF67CBF536@microsoft.com...> >> > > Hey eb
> > > can this be the reason for huge memory expansion ?
> > > Doesn't this script free memory of the object it had created?
> > >
> > > sub createCOMobject()
> > > set obj1 = createObject("object1")
> > > dim flag = 1
> > > useObject flag,obj1
> > > end sub
> > > ----------------------------------
> > > sub useObject (flag, byRef obj1)
> > > ...
> > > set obj1 = Nothing
> > > end sub
> > >
> > > Thanks for your attention
> > > Rea
> > >
> > Setting an object variable to nothing does not free memory.
> >
> > Assigning a new value (whatever it is not just nothing) to variable will
> > cause the release method of the any currently held reference to bethen> > before the reference is replaced by the new value.
> >
> > Calling release on an interface reference (commonly known as an object
> > variable) causes the object to decrement an internally held count of the
> > number of references that have been made. When this count reaches zeroof> > it is the object's responsibility to deallocate any memory or other
> > resources it may be holding.
> >
> > obj1 is passed byRef (the default mode in VBScript BTW) so the assigningthe> > Nothing to obj1 is applied to the variable of the same name in the
> > createCOMobject procedure. Since this is the only reference being heldshould> > internal reference count of the object drops to zero and the objectthis> > destroy itself at this point.
> >
> > However without the line assigning nothing to the obj1 variable the obj1
> > variable is destroyed when the procedure createCOMobject returns, atcalled.> > point any reference currently held in obj1 has it's release method> > Hence in this case the assignment of nothing is superflous.
> >
> > HTH,
> >
> > Anthony.
> >
> >
> >
> >
Anthony Jones Guest



Reply With Quote

