473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Watching memory use. What tools can I use

Im sat here watching task manager and the memory consumption of my
application rising second by second.
What tools are there out there for me to use to find where it's all going
please?
(I wish we were able to do garbage collection ourselves. Excruciatingly poor
idea microsoft. That's been the most annoying part of dotnet)
Ive looked at some web pages talking about using the gc class to force
garbage collection. Is this something that can break your application? I am
doing realtime data collection and need to keep creating and destroying
objects quickly.

thanks
Claire
Nov 17 '05 #1
7 2615
Hi Claire,

You can safetly call to the Collect of the garbage collector however MS says
that you should keep them trying it. The memory consumption is in purpose?
Maybe the problem is not the GC and is the app. The GC automatically will
promote and destruct objects when your system is needed for more memory. You
can collect any generation but I recommend it to do it on the first one.

If you use large object and you need to reaccess them try using
weakreference object, I have used it to keep my memory happy several times.

DevPartner has plenty of tools, but is not cheap :(

You can write also a small app to check the GC status.

Hope this info is useful for your,
best regards
"Claire" wrote:
Im sat here watching task manager and the memory consumption of my
application rising second by second.
What tools are there out there for me to use to find where it's all going
please?
(I wish we were able to do garbage collection ourselves. Excruciatingly poor
idea microsoft. That's been the most annoying part of dotnet)
Ive looked at some web pages talking about using the gc class to force
garbage collection. Is this something that can break your application? I am
doing realtime data collection and need to keep creating and destroying
objects quickly.

thanks
Claire

Nov 17 '05 #2
http://sysinternals.com has some good utilities and stuff for free.

Good luck
--
Thanks,
TheBurgerMan
at
gmail.com
--
"Claire" <as*******@ntlworld.com> wrote in message
news:eO**************@TK2MSFTNGP09.phx.gbl...
Im sat here watching task manager and the memory consumption of my
application rising second by second.
What tools are there out there for me to use to find where it's all going
please?
(I wish we were able to do garbage collection ourselves. Excruciatingly
poor idea microsoft. That's been the most annoying part of dotnet)
Ive looked at some web pages talking about using the gc class to force
garbage collection. Is this something that can break your application? I
am doing realtime data collection and need to keep creating and destroying
objects quickly.

thanks
Claire

Nov 17 '05 #3
Claire,

take a look at the profiler sample from the sdk. it will tell you
exactly where the memory was allocated, and what objects
have been created.

WM_HOPETHISHELPS
thomas woelfer
http://www.die.de/blog
"Claire" <as*******@ntlworld.com> schrieb im Newsbeitrag news:eO**************@TK2MSFTNGP09.phx.gbl...
Im sat here watching task manager and the memory consumption of my application rising second by second.
What tools are there out there for me to use to find where it's all going please?
(I wish we were able to do garbage collection ourselves. Excruciatingly poor idea microsoft. That's been the most annoying part of
dotnet)
Ive looked at some web pages talking about using the gc class to force garbage collection. Is this something that can break your
application? I am doing realtime data collection and need to keep creating and destroying objects quickly.

thanks
Claire

Nov 17 '05 #4
Claire,

Besides watching the "Mem Usage" column rise in Task Manager, are you
seeing any detrimental effects on your system or in your application? The
reason I ask is that the GC is pretty good about reclaiming and releasing
memory, but only if you leave it alone. There are few cases where you want
to actually call a GC, or try and handle this yourself.

Rather, you should be designing classes and coding in such a way as to
assist the GC and your app in running smoothly (using IDisposable, using
statements, no finalizers if not necessary, etc, etc).

If you are running into a specific problem that you believe is
memory-related, then what is it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Claire" <as*******@ntlworld.com> wrote in message
news:eO**************@TK2MSFTNGP09.phx.gbl...
Im sat here watching task manager and the memory consumption of my
application rising second by second.
What tools are there out there for me to use to find where it's all going
please?
(I wish we were able to do garbage collection ourselves. Excruciatingly
poor idea microsoft. That's been the most annoying part of dotnet)
Ive looked at some web pages talking about using the gc class to force
garbage collection. Is this something that can break your application? I
am doing realtime data collection and need to keep creating and destroying
objects quickly.

thanks
Claire

Nov 17 '05 #5
> If you are running into a specific problem that you believe is
memory-related, then what is it?


I started a session of Delphi. It told me it had run out of resources.
It all seems to be fine but I'm seeing the "Commit Charge(K)" Total level
rising at a steady rate the longer I leave my application running. As it's
in development I haven't left it running for more than a few minutes at a
time.
Im creating ArrayLists, filling them with header objects that host
arraylists of detail objects. These objects are created from records filled
by an emulated dll (the real dll sits on a ship). I pass a byte array to the
dll for it to fill with data.
I pass the array lists from level to level, their contents are moved,
filtered, then finally the contents are translated into other generic
objects that will be passed to a database.

Nov 17 '05 #6
> If you are running into a specific problem that you believe is
memory-related, then what is it?


I started a session of Delphi. It told me it had run out of resources.
It all seems to be fine but I'm seeing the "Commit Charge(K)" Total level
rising at a steady rate the longer I leave my application running. As it's
in development I haven't left it running for more than a few minutes at a
time.
Im creating ArrayLists, filling them with header objects that host
arraylists of detail objects. These objects are created from records filled
by an emulated dll (the real dll sits on a ship). I pass a byte array to the
dll for it to fill with data.
I pass the array lists from level to level, their contents are moved,
filtered, then finally the contents are translated into other generic
objects that will be passed to a database.

Nov 17 '05 #7

"Claire" <as*******@ntlworld.com> wrote in message
news:eO**************@TK2MSFTNGP09.phx.gbl...
Im sat here watching task manager and the memory consumption of my
application rising second by second.
What tools are there out there for me to use to find where it's all going
please?
(I wish we were able to do garbage collection ourselves. Excruciatingly
poor idea microsoft. That's been the most annoying part of dotnet)
Ive looked at some web pages talking about using the gc class to force
garbage collection. Is this something that can break your application? I
am doing realtime data collection and need to keep creating and destroying
objects quickly.

thanks
Claire


Before you start measuring, you should have a good understanding on how the
Windows memory manager works, how and what kind memory gets allocated, this
is necessary because the managed heap is nothing else than a private Process
heap who's internal allocations are managed by the CLR/GC.
Read as much as you can about the GC and it's inner workings, don't take any
action before you perfectly understand all issues, don't think you can do
better than the GC itself, you won't.
A good start to learn about managed memory, are these Blogs, authored by the
CLR architects at MS.

http://blogs.msdn.com/maoni/archive/category/5507.aspx
http://blogs.msdn.com/maoni/archive/...03/148029.aspx
http://blogs.msdn.com/ricom/archive/category/2050.aspx
http://msdn.microsoft.com/library/de...anagedcode.asp

And do as Rico suggests here:
http://blogs.msdn.com/ricom/archive/...29/271829.aspx
and here:
http://blogs.msdn.com/ricom/archive/.../02/40780.aspx
Don't use GC.Collect().
The garbage collector is self-tuning. By programmatically forcing a
collection with this method, the chances are you hinder rather than improve
performance.

To measure you have to use the right tools:
Start with the performance monitor and watch the:
- CLR's Memory (GC) performance counters.
Watch the sizes of the Gen0, 1, 2 and the LH heap, pay attention to
the GC collections/sec for each of the generations.
- Process memory counters.
Watch the private heap size and Working Set.

If it looks like a GC issue, that is GC memory consumption tends to climb
without returning.
Use a profiler to investigate how your application interacts with the
managed heap.
There exists an number of memory profilers for .NET, some are free other are
not, start with this one
http://download.microsoft.com/downlo...filer.exe.just to get an idea of what you can expect.Check this for a list of available profilers:http://blogs.msdn.com/brada/archive/...398060.aspxbut also take a look at this and don't start measuring the wrong thing.http://blogs.msdn.com/ricom/archive/...7/74659.aspxIf you think you got memory leaks you can't find using 1 and/or 2, you willhave to use some other tools.The first one I can think of is Windbghttp://www.microsoft.com/whdc/devtools/debugging/default.mspx, asophisticated debugger, that, when used with the sos.dll extension, allowsyou to peek at the internals of the CLR.Another tools is vadump included with the platform SDK or available fordownload from:http://www.microsoft.com/windows2000...ump-o.aspWilly.

Nov 17 '05 #8

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

Similar topics

7
by: Andy Bulka | last post by:
Whilst almost responding to the 'dream project' thread I decided that this post warranted its own thread. What about a solid UML tool with round trip functionality for the Python Community? ...
33
by: Steven Bethard | last post by:
I feel like this has probably been answered before, but I couldn't find something quite like it in the archives. Feel free to point me somewhere if you know where this has already been answered. ...
9
by: Birgit Rahm | last post by:
Hello newsgroup, I am a beginner, so I am asking maybe immoderate questions. I want to delete a variable, after filling it with complex objects. How should I do it? e.g. AAA = AAA = Can I...
2
by: liangrf | last post by:
My server app is transformed from environment of UNIX to Windows. Its ran on the Apache Windows Server. The code is compiled pass by MSVC6 and ran well. but it has more memory leak. when I am...
16
by: JCauble | last post by:
We have a large Asp.net application that is currently crashing our production servers. What we are seeing is the aspnet_wp eat up a bunch of memory and then stop unexpectedly. Does not recycle. ...
1
by: anandav2001 | last post by:
Hello developers, I have created an executable(system tray application) in VS.net 2003 using VB.net. My app was taking 30 MB memory(since some web services call are there which happens for each...
4
by: Michael | last post by:
Hi! (OK, slightly silly subject line :) I'm extremely pleased to say - Kamaelia 0.4.0 has been released! What's New & Changed? =====================
1
by: Michael Schuerig | last post by:
I'm looking for strategies to find and prevent unnecessary memory consumption. This includes real memory leaks caused by browser bugs, of course, but beyond that I'm also thinking of closures that...
17
by: Cesar | last post by:
Hello people. I'm having a Winform app that contains a webbrowser control that keeps navigating from one page to another permanentrly to make some tests. The problem I'm having is that after a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.