Task Manager - Memory Usage


Author
Message
Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
I noticed something with memory usage with .NET applications that I didn't see with VB6 Apps, and was wondering if I'm doing something wrong or if this is normal behavior.

I created a small test SF Maintenance form with a browse dialog.  I invoke the browse and perform a search...memory jumps up a little.  I close the dialog and memory does not go back down.  I then invoke the browse again.. and again... memory keeps increasing.

Is this normal?  I made sure I disposed of all objects.

Thanks
Tim

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, with .NET this is normal... the memory does not go back down until the Garbage Collector decides to run a collection, and generally, a collection isn't run until the application gets to the point where it's reaching it's defined heap limit (which is bigger the more RAM you have in the machine...).  So, even when you dispose of something, the actual memory is not reclaimed until the garbage collector runs.  You can run a collection manually by calling GC.Collect(), but I would recommend against it because it can slow down you application considerably letting .NET run it on its own works for about 99.999% of the time Smile

Generally, if you watch it long enough, you'll notice a big drop in the amount of memory... and you know a collection was just run.

Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I heard that is utility in Java to do garbage collection manually to clean up memory. Is there any in .NET? I need it to clean up memory during design time.

Thank you

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yes, though it is not recommended, but you can force the garabage collection by calling GC.Collect().
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search