473,700 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What good is this automatic garbage collector?

joe
I have a simple .NET application with two or three listViews which are
filled with icons and when the user click on the proper item, they display
the related images. I use "image = null ; " for all images that have been
used and are going to be closed. This is how ever no way to reduce the
memory consumption. I have noticed , using the task manager, that garbage
collector doesn't actually do any collections unless the computer becomes
low on memory. This is very foolish, and what good is a garbage collector
which doesn't collect the disposed objects when they aren't needed anymore?

Besides, calling CG.Collect() is usually avoided for performance and speed.
What else can i do?

PS: i wont hurt you to read this:
http://www.cs.tut.fi/~warp/MicrosoftComparingLanguages/

Jul 21 '05
28 3360
> GC is a big work! if u set some enviroment variable , GC can occured every
time, but is's too slowly.. Exactly what setting is that?

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"juqiang" <ju*****@discus sions.microsoft .com> wrote in message
news:23******** *************** ***********@mic rosoft.com... GC is a big work! if u set some enviroment variable , GC can occured every
time, but is's too slowly...Of course, if u want to find some memory
problems(such as leak) ,this is a good idea.
GC.Collect() is not a good idea, u'd better NOT call this method in your
code.

"Brian Gideon" wrote:


joe wrote:
>
> [snip]
>
> PS: i wont hurt you to read this:
> http://www.cs.tut.fi/~warp/MicrosoftComparingLanguages/


I disagree. While some aspects of the article may be at least
partially correct, it does more harm than good. For example, the
author completely missed the point of the original claim about reduced
memory leaks. Similarly, I thought the other points were
misinterpreted as well, albiet, to a lesser degree.

Brian

Jul 22 '05 #21
"Cor Ligthert" wrote:
To use a methpore "Do you empty your trash bin, everytime you have thrown in
a paper or whatever?


Actually, a better metaphor would be that the act of throwing your paper in
the trash is the act of garbage collection. Just as the system leaves objects
in memory until they are collected, you would leave paper you've finished
with lying on your desk. Eventually, you'll get to a point where you have so
much scrap paper around that you have a tidy-up.

Me, when I finish with a paper, I scrunch it up and chuck it there and then.
Makes my working environment much cleaner and tidier... but then, I do work
in C++ :)

Jul 22 '05 #22
Well, apart from issues like system performance - where the cache size is
reduced because some app is hogging all available RAM, we have had issues
with ASP.net apps that keep on using more and more memory causing other apps
to run into difficulties.

"Scott M." wrote:
Why exactly are you trying to reclaim memory when there is still plenty of
memory for you application to run?
"joe" <jo*****@rot.of m.net> wrote in message
news:ub******** ******@tk2msftn gp13.phx.gbl...

"Patrice" <no****@nowhere .com> wrote in message
news:eZ******** *****@TK2MSFTNG P15.phx.gbl...
Have you tried to call Dispose ?


Dispose is not supported on all objects. In my case, calling GC.collect()
does a little help though.
Though the point of a garbage collector is that there is no need to
reclaim
memory if you have no use for it, it's worth to keep in mind that it have
its root in the managed world and that the Dispose or Close methods
should
still allows to reclaim unmanaged memory immediately...


Yes, in a perfect managed world where no one wants to struggle with memory
allocation and release, this could be good suggestion. But in the same
managed world there are times when an object is used only "once", and then
thrown away forever or used after a long time or maybe in next program
launch. Why should its memory be still occupied by the program?
I mean, there should a way to have more control over this kind of memory
management. ( sth like a half-automatic GC, until the day GC becomes
really
smart and intelligence)

i can also use SetProcessWorki ngSetSize(-1,-1) , however it is not usually
recommended.


Jul 22 '05 #23
Nick,
The notion of memory getting cheap is really relative. You buy the best
possible machine required for your business. By the time you need more memory
the processor and the memory technology are outdated. You dont always get
what you want. The end user of software wants return on his investment and
the time frame for each update is very short.
I am currently facing a problem where the guys in field have PIII machines
with 256 MB RAM and the start up time for framework is killing the app. Also
the memory requirements for reporting tool are also becoming performance
bottleneck. My client gets distributes the software to get the business from
agents in field. He can't control the hardware beyond a point. He has to
support hardware that came into market 3 years back. The guy in field has
simply not recovered his investment or does not require additional H/W for
his other work.
Not all guys get enough money to throw their PCs or worse case laptops in
dustbin every 2 years.

"Nick Malik [Microsoft]" wrote:
Hello Joe,

I appreciate that you are taking a reasoned approach.

I also agree that a case could be made for fine-tuning the GC. That said,
Willy's comment is correct... the GC really does run more often than you
think. Also page swapping, as caused by .Net apps, is probably less than
you think. Note that a page is only swapped "in" when memory on that page
is referenced. If the page is completely empty of active objects, then it
will not swap in until the GC frees it. (This actually slows the system
down if you do this too often).

You refer to how much faster the system runs after a while. This is
completely true. However, it is also often the case that the culprit for
this kind of memory fragmentation is the use of unmanaged objects that don't
drop their references and therefore create gaps in the memory space that is
difficult for the heap allocation system to reuse.

As for low-memory systems, I would assert that you are using the OS at or
near the smallest amount of memory that it supports. Normal OS operations
will fragment the memory, all by themselves, without any help from your app.
In this case, .Net is not able to really improve the situation.

Note that the OS teams have made real strides over the years in improving
how memory is used. However, as memory has become so much less expensive,
it is not unreasonable to expect that users will occasionally upgrade their
memory when they install a new OS to get new features like better security,
better handling of multimedia, more efficient file systems and (strictly for
the non-server environments) more advanced games.

I hope this helps. I understand your frustration. (One of my systems at
home has 256M of RAM, too... I'm just too lazy to run down to Fry's and get
a memory module for it :-(.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"joe" <jo*****@rot.of m.net> wrote in message
news:OM******** ******@TK2MSFTN GP10.phx.gbl...
Nick,
Your reasoning is respected and welcomed. I don't hate or love something
like idiots, i simply point out the weak points.

It is true that CG is a great miracle in C# and java, and help the
programmer to concentrate on more critical aspects of his work, however,
when it comes to page faults, it exhibits its weak points.

You might say that because allocation or garbage collection is done only
when the computer becomes low on memory, you gain much higher performance
in your application. This can be true for small programs, however, when
some real big programs are executed on computers with low memory ( sth
like 256 MB) , then the amount of OS's page swapping and virtual memory
reading and writing really slows down the entire system. Just think, why
your OS is much faster after a clean restart than the time it is run for
long hours of application executing and playing with the virtual memory?

Well, at least there could be stricter algorithm implemented, which would
force the GC to come into play much sooner that it does now on low-memory
PCs.
"Nick Malik [Microsoft]" <ni*******@hotm ail.nospam.com> wrote in message
news:pI******** ************@co mcast.com...

PS: i wont hurt you to read this:
http://www.cs.tut.fi/~warp/MicrosoftComparingLanguages/
This commentary is a case of one inexperienced programmer criticizing a
feature that they do not understand, with poor understanding of the
forces that underlie the fundamental reasoning. Garbage collection is
easy in C++... if every developer were free of mistakes and if code were
not complex. This is not the case in the real world. The author of that
article completely failed to recognize the reality of memory leaks in a
production system of substantial size.

One reason for the success of BOTH Java and .Net languages like C# is
that this problem is solved for you. You may not agree with the way in
which it is solved, but it is solved for you. That is a huge step up and
a major boon for software development.

The problem isn't the computers or their languages... it is the
limitations of the humans who use them.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.



Jul 22 '05 #24
Hemant,

I think that if you write about history you have to be correct.

I am currently facing a problem where the guys in field have PIII machines
with 256 MB RAM and ......... <snip>He has to support hardware that came into market 3 years back.


http://arstechnica.com/articles/paed...entium-1.ars/3

I hope this helps,

Cor
Jul 22 '05 #25
Hi HermanT,

Cor has a point. Two of my home systems are business-class PIII with 256K
RAM: they were purchased new by my dot-com in 1999... six years ago.

I don't know if you work in the USA or not. In the USA, the federal
government allows a business to write off 100% of the depreciation cost of a
new computer in the same year in which it is purchased. So your business
recovered about a third of the cost of the machines that year in tax
offsets.

My business-class machines cost about $1500 new (I know because part of my
job was to approve their purchase). At today's prices, my two
business-class systems will cost me about $100 each to upgrade to 512MB.
http://www.memorydealers.com/dixpst5.html

Both machines are perfectly serviceable and I have no intention of getting
rid of either any time soon, although I'll have to replace a monitor this
year, and I pulled a power supply in a third (newer) machine about four
months ago. I probably put about $80 per year per machine into upkeep, not
including my time spent under the hood.

So, you won't hear a lot of pity from me when discussing a business that is
too cheap to purchase an inexpensive upgrade five or six years after the
computer was purchased. Even including the overhead, spending $300 per year
to keep up a $1500 investment isn't asking a lot.

Now back to software,

According to you, your application is slow starting up because of the
framework loading up in a memory constrained environment. Consider this
option: put a service in their machine that starts up, sets a timer for five
minutes, and goes to sleep... waking up every five minutes to go back to
sleep. Now, when your app loads, the framework is in memory. It's a
kludge, granted, but it may save your business a whopping $100 per machine.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Hemant" <He****@discuss ions.microsoft. com> wrote in message
news:03******** *************** ***********@mic rosoft.com...
Nick,
The notion of memory getting cheap is really relative. You buy the best
possible machine required for your business. By the time you need more
memory
the processor and the memory technology are outdated. You dont always get
what you want. The end user of software wants return on his investment and
the time frame for each update is very short.
I am currently facing a problem where the guys in field have PIII machines
with 256 MB RAM and the start up time for framework is killing the app.
Also
the memory requirements for reporting tool are also becoming performance
bottleneck. My client gets distributes the software to get the business
from
agents in field. He can't control the hardware beyond a point. He has to
support hardware that came into market 3 years back. The guy in field has
simply not recovered his investment or does not require additional H/W for
his other work.
Not all guys get enough money to throw their PCs or worse case laptops in
dustbin every 2 years.

"Nick Malik [Microsoft]" wrote:
Hello Joe,

I appreciate that you are taking a reasoned approach.

I also agree that a case could be made for fine-tuning the GC. That
said,
Willy's comment is correct... the GC really does run more often than you
think. Also page swapping, as caused by .Net apps, is probably less than
you think. Note that a page is only swapped "in" when memory on that
page
is referenced. If the page is completely empty of active objects, then
it
will not swap in until the GC frees it. (This actually slows the system
down if you do this too often).

You refer to how much faster the system runs after a while. This is
completely true. However, it is also often the case that the culprit for
this kind of memory fragmentation is the use of unmanaged objects that
don't
drop their references and therefore create gaps in the memory space that
is
difficult for the heap allocation system to reuse.

As for low-memory systems, I would assert that you are using the OS at or
near the smallest amount of memory that it supports. Normal OS
operations
will fragment the memory, all by themselves, without any help from your
app.
In this case, .Net is not able to really improve the situation.

Note that the OS teams have made real strides over the years in improving
how memory is used. However, as memory has become so much less
expensive,
it is not unreasonable to expect that users will occasionally upgrade
their
memory when they install a new OS to get new features like better
security,
better handling of multimedia, more efficient file systems and (strictly
for
the non-server environments) more advanced games.

I hope this helps. I understand your frustration. (One of my systems at
home has 256M of RAM, too... I'm just too lazy to run down to Fry's and
get
a memory module for it :-(.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"joe" <jo*****@rot.of m.net> wrote in message
news:OM******** ******@TK2MSFTN GP10.phx.gbl...
> Nick,
> Your reasoning is respected and welcomed. I don't hate or love
> something
> like idiots, i simply point out the weak points.
>
> It is true that CG is a great miracle in C# and java, and help the
> programmer to concentrate on more critical aspects of his work,
> however,
> when it comes to page faults, it exhibits its weak points.
>
> You might say that because allocation or garbage collection is done
> only
> when the computer becomes low on memory, you gain much higher
> performance
> in your application. This can be true for small programs, however, when
> some real big programs are executed on computers with low memory ( sth
> like 256 MB) , then the amount of OS's page swapping and virtual memory
> reading and writing really slows down the entire system. Just think,
> why
> your OS is much faster after a clean restart than the time it is run
> for
> long hours of application executing and playing with the virtual
> memory?
>
> Well, at least there could be stricter algorithm implemented, which
> would
> force the GC to come into play much sooner that it does now on
> low-memory
> PCs.
>
>
> "Nick Malik [Microsoft]" <ni*******@hotm ail.nospam.com> wrote in
> message
> news:pI******** ************@co mcast.com...
>>
>>> PS: i wont hurt you to read this:
>>> http://www.cs.tut.fi/~warp/MicrosoftComparingLanguages/
>>>
>>
>> This commentary is a case of one inexperienced programmer criticizing
>> a
>> feature that they do not understand, with poor understanding of the
>> forces that underlie the fundamental reasoning. Garbage collection is
>> easy in C++... if every developer were free of mistakes and if code
>> were
>> not complex. This is not the case in the real world. The author of
>> that
>> article completely failed to recognize the reality of memory leaks in
>> a
>> production system of substantial size.
>>
>> One reason for the success of BOTH Java and .Net languages like C# is
>> that this problem is solved for you. You may not agree with the way
>> in
>> which it is solved, but it is solved for you. That is a huge step up
>> and
>> a major boon for software development.
>>
>> The problem isn't the computers or their languages... it is the
>> limitations of the humans who use them.
>> --
>> --- Nick Malik [Microsoft]
>> MCSD, CFPS, Certified Scrummaster
>> http://blogs.msdn.com/nickmalik
>>
>> Disclaimer: Opinions expressed in this forum are my own, and not
>> representative of my employer.
>> I do not answer questions on behalf of my employer. I'm just a
>> programmer helping programmers.
>
>


Jul 22 '05 #26
Unfortunately, USA does not understand problems of rest of the world.
Currently we are working for a client in South Africa. Also the service
option does not work for Windows 98, which is still one of the very popular
OS in rest of the world. .Net Framework is supposed to be world ready. That
is why it has Unicode.

The PIII machine with 866MHz and 128MB RAM is about 4-5 years old in this
part of the world and $100 when converted to other currencies is not a small
amount for many people. Client is asking the users to upgrade and will stop
supporting these systems. But that is still one year away. And altough not
all are like this, 13% of the users are still using these systems. This is
not a small fraction.

Hope you realize the problems in field. I am not putting any dream in front
of you. This is reallity. The parameters by which you upgrade the systems are
not always valid in the field.

Regards and good luck for your work.
"Nick Malik [Microsoft]" wrote:
Hi HermanT,

Cor has a point. Two of my home systems are business-class PIII with 256K
RAM: they were purchased new by my dot-com in 1999... six years ago.

I don't know if you work in the USA or not. In the USA, the federal
government allows a business to write off 100% of the depreciation cost of a
new computer in the same year in which it is purchased. So your business
recovered about a third of the cost of the machines that year in tax
offsets.

My business-class machines cost about $1500 new (I know because part of my
job was to approve their purchase). At today's prices, my two
business-class systems will cost me about $100 each to upgrade to 512MB.
http://www.memorydealers.com/dixpst5.html

Both machines are perfectly serviceable and I have no intention of getting
rid of either any time soon, although I'll have to replace a monitor this
year, and I pulled a power supply in a third (newer) machine about four
months ago. I probably put about $80 per year per machine into upkeep, not
including my time spent under the hood.

So, you won't hear a lot of pity from me when discussing a business that is
too cheap to purchase an inexpensive upgrade five or six years after the
computer was purchased. Even including the overhead, spending $300 per year
to keep up a $1500 investment isn't asking a lot.

Now back to software,

According to you, your application is slow starting up because of the
framework loading up in a memory constrained environment. Consider this
option: put a service in their machine that starts up, sets a timer for five
minutes, and goes to sleep... waking up every five minutes to go back to
sleep. Now, when your app loads, the framework is in memory. It's a
kludge, granted, but it may save your business a whopping $100 per machine.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Hemant" <He****@discuss ions.microsoft. com> wrote in message
news:03******** *************** ***********@mic rosoft.com...
Nick,
The notion of memory getting cheap is really relative. You buy the best
possible machine required for your business. By the time you need more
memory
the processor and the memory technology are outdated. You dont always get
what you want. The end user of software wants return on his investment and
the time frame for each update is very short.
I am currently facing a problem where the guys in field have PIII machines
with 256 MB RAM and the start up time for framework is killing the app.
Also
the memory requirements for reporting tool are also becoming performance
bottleneck. My client gets distributes the software to get the business
from
agents in field. He can't control the hardware beyond a point. He has to
support hardware that came into market 3 years back. The guy in field has
simply not recovered his investment or does not require additional H/W for
his other work.
Not all guys get enough money to throw their PCs or worse case laptops in
dustbin every 2 years.

"Nick Malik [Microsoft]" wrote:
Hello Joe,

I appreciate that you are taking a reasoned approach.

I also agree that a case could be made for fine-tuning the GC. That
said,
Willy's comment is correct... the GC really does run more often than you
think. Also page swapping, as caused by .Net apps, is probably less than
you think. Note that a page is only swapped "in" when memory on that
page
is referenced. If the page is completely empty of active objects, then
it
will not swap in until the GC frees it. (This actually slows the system
down if you do this too often).

You refer to how much faster the system runs after a while. This is
completely true. However, it is also often the case that the culprit for
this kind of memory fragmentation is the use of unmanaged objects that
don't
drop their references and therefore create gaps in the memory space that
is
difficult for the heap allocation system to reuse.

As for low-memory systems, I would assert that you are using the OS at or
near the smallest amount of memory that it supports. Normal OS
operations
will fragment the memory, all by themselves, without any help from your
app.
In this case, .Net is not able to really improve the situation.

Note that the OS teams have made real strides over the years in improving
how memory is used. However, as memory has become so much less
expensive,
it is not unreasonable to expect that users will occasionally upgrade
their
memory when they install a new OS to get new features like better
security,
better handling of multimedia, more efficient file systems and (strictly
for
the non-server environments) more advanced games.

I hope this helps. I understand your frustration. (One of my systems at
home has 256M of RAM, too... I'm just too lazy to run down to Fry's and
get
a memory module for it :-(.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"joe" <jo*****@rot.of m.net> wrote in message
news:OM******** ******@TK2MSFTN GP10.phx.gbl...
> Nick,
> Your reasoning is respected and welcomed. I don't hate or love
> something
> like idiots, i simply point out the weak points.
>
> It is true that CG is a great miracle in C# and java, and help the
> programmer to concentrate on more critical aspects of his work,
> however,
> when it comes to page faults, it exhibits its weak points.
>
> You might say that because allocation or garbage collection is done
> only
> when the computer becomes low on memory, you gain much higher
> performance
> in your application. This can be true for small programs, however, when
> some real big programs are executed on computers with low memory ( sth
> like 256 MB) , then the amount of OS's page swapping and virtual memory
> reading and writing really slows down the entire system. Just think,
> why
> your OS is much faster after a clean restart than the time it is run
> for
> long hours of application executing and playing with the virtual
> memory?
>
> Well, at least there could be stricter algorithm implemented, which
> would
> force the GC to come into play much sooner that it does now on
> low-memory
> PCs.
>
>
> "Nick Malik [Microsoft]" <ni*******@hotm ail.nospam.com> wrote in
> message
> news:pI******** ************@co mcast.com...
>>
>>> PS: i wont hurt you to read this:
>>> http://www.cs.tut.fi/~warp/MicrosoftComparingLanguages/
>>>
>>
>> This commentary is a case of one inexperienced programmer criticizing
>> a
>> feature that they do not understand, with poor understanding of the
>> forces that underlie the fundamental reasoning. Garbage collection is
>> easy in C++... if every developer were free of mistakes and if code
>> were
>> not complex. This is not the case in the real world. The author of
>> that
>> article completely failed to recognize the reality of memory leaks in
>> a
>> production system of substantial size.
>>
>> One reason for the success of BOTH Java and .Net languages like C# is
>> that this problem is solved for you. You may not agree with the way
>> in
>> which it is solved, but it is solved for you. That is a huge step up
>> and
>> a major boon for software development.
>>
>> The problem isn't the computers or their languages... it is the
>> limitations of the humans who use them.
>> --
>> --- Nick Malik [Microsoft]
>> MCSD, CFPS, Certified Scrummaster
>> http://blogs.msdn.com/nickmalik
>>
>> Disclaimer: Opinions expressed in this forum are my own, and not
>> representative of my employer.
>> I do not answer questions on behalf of my employer. I'm just a
>> programmer helping programmers.
>
>


Jul 22 '05 #27

"andy" <an**@discussio ns.microsoft.co m> wrote in message
news:C3******** *************** ***********@mic rosoft.com...
Well, apart from issues like system performance - where the cache size is
reduced because some app is hogging all available RAM,
But some app wouldn't be hogging all available RAM because that's exactly
when the GC would kick in.

we have had issues with ASP.net apps that keep on using more and more
memory causing other apps
to run into difficulties.
I would think that this may be because of incorrect usage and cleanup of
objects and their unmanaged resources.

"Scott M." wrote:
Why exactly are you trying to reclaim memory when there is still plenty
of
memory for you application to run?
"joe" <jo*****@rot.of m.net> wrote in message
news:ub******** ******@tk2msftn gp13.phx.gbl...
>
> "Patrice" <no****@nowhere .com> wrote in message
> news:eZ******** *****@TK2MSFTNG P15.phx.gbl...
>> Have you tried to call Dispose ?
>
> Dispose is not supported on all objects. In my case, calling
> GC.collect()
> does a little help though.
>
>> Though the point of a garbage collector is that there is no need to
>> reclaim
>> memory if you have no use for it, it's worth to keep in mind that it
>> have
>> its root in the managed world and that the Dispose or Close methods
>> should
>> still allows to reclaim unmanaged memory immediately...
>
> Yes, in a perfect managed world where no one wants to struggle with
> memory
> allocation and release, this could be good suggestion. But in the same
> managed world there are times when an object is used only "once", and
> then
> thrown away forever or used after a long time or maybe in next program
> launch. Why should its memory be still occupied by the program?
> I mean, there should a way to have more control over this kind of
> memory
> management. ( sth like a half-automatic GC, until the day GC becomes
> really
> smart and intelligence)
>
> i can also use SetProcessWorki ngSetSize(-1,-1) , however it is not
> usually
> recommended.
>
>
>


Jul 22 '05 #28
Hmmm. I think the first metaphor is a bit closer to what is actually
happening. When you put something into a garbage can, it isn't actually
gone yet. It is when you empty the trash that the item is gone forever.
"Andy Bolstridge" <Andy Bo********@disc ussions.microso ft.com> wrote in
message news:B9******** *************** ***********@mic rosoft.com...
"Cor Ligthert" wrote:
To use a methpore "Do you empty your trash bin, everytime you have thrown
in
a paper or whatever?


Actually, a better metaphor would be that the act of throwing your paper
in
the trash is the act of garbage collection. Just as the system leaves
objects
in memory until they are collected, you would leave paper you've finished
with lying on your desk. Eventually, you'll get to a point where you have
so
much scrap paper around that you have a tidy-up.

Me, when I finish with a paper, I scrunch it up and chuck it there and
then.
Makes my working environment much cleaner and tidier... but then, I do
work
in C++ :)

Jul 22 '05 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
367
by: joe | last post by:
I have a simple .NET application with two or three listViews which are filled with icons and when the user click on the proper item, they display the related images. I use "image = null ; " for all images that have been used and are going to be closed. This is how ever no way to reduce the memory consumption. I have noticed , using the task manager, that garbage collector doesn't actually do any collections unless the computer becomes low...
0
8645
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9075
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7810
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4404
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.