Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2007

Tip: Looking for answers? Try searching our database.

Making ones own memory profiler lite in c#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam Samson - 30 Aug 2007 08:09 GMT
Can any-one recommend some good sites detailing how to code a simple memory
profiler?
How do they "look under the hood"?

I built an uber simple service that tracks the process' memory but I need
to "get inside" and look a bit deeper and I don't have a clue where to start
.. a commercial memory profiler is not an option due the nature of the environment
the application is deployed in ..

My app runs fine for weeks (in 8 locations) but every now and again it goes
BOOOOOM
Operator feedback is non-existent so how they do it eludes me and it never
ever misbehaves in the test environment.

So my plan is to automatically detect when the app is starting to creep up
and start looking inside to see what exactly is going on. (its a plan of
sorts)

If I dont go insane before then ...

---------------------------------------------
[Sam Samson] - There is no greater folly than fixed price quoting.
Ollie - 30 Aug 2007 11:48 GMT
Hi Sam,

have you checked out the .Net Profiler API? there are loads of great
articles on the MSDN website:

http://msdn.microsoft.com/msdnmag/issues/03/01/NETProfilerAPI/
http://msdn.microsoft.com/msdnmag/issues/05/01/CLRProfiler/
http://msdn.microsoft.com/msdnmag/issues/06/04/NETProfiling/default.aspx#Resources

As for your application are you using any logging and tracing? surely you
could increase the logging when you believe the application is behaving in a
strange manner.

Why can't you use a memory profiler in product if you can't recreate the
problem in development?

HTH

Ollie Riches

> Can any-one recommend some good sites detailing how to code a simple memory
> profiler?
[quoted text clipped - 18 lines]
> ---------------------------------------------
> [Sam Samson] - There is no greater folly than fixed price quoting.
Sam Samson - 31 Aug 2007 00:51 GMT
Hello Ollie,

> have you checked out the .Net Profiler API? there are loads of great
> articles on the MSDN website:
[quoted text clipped - 3 lines]
> http://msdn.microsoft.com/msdnmag/issues/06/04/NETProfiling/default.as
> px#Resources

Nope hadn't but now I have a starting place so shall be real soon. Thanks

> As for your application are you using any logging and tracing? surely
> you could increase the logging when you believe the application is
> behaving in a strange manner.

I log all caught and uncaught exceptions .. but this has revealed nothing
... I peppered the application with 'trace' points that gives me an idea
what it was doing at any given time. but I cant collect the right information
here ..

> Why can't you use a memory profiler in product if you can't recreate
> the problem in development?

I havent found any in-product ones yet that I could A) understand ... b)
Afford C) run on a machine in the production environment.(locked down PC's)

Thats not to say there isn't a product that fits the bill ... I just havent
found it yet.

> Ollie Riches
>
[quoted text clipped - 19 lines]
>> ---------------------------------------------
>> [Sam Samson] - There is no greater folly than fixed price quoting.
Ollie - 31 Aug 2007 10:56 GMT
Hi Sam,

I suggest you use the System.Diagnostics.Trace class as this will output
trace information in realtime, it can be viewed using a tool called Debug
Viewer

http://www.microsoft.com/technet/sysinternals/Miscellaneous/DebugView.mspx

and also process monitor & process explorer, which gives more information
than task manager

http://www.microsoft.com/technet/sysinternals/systeminformationutilities.mspx?wt
.svl=featured


Also if you want to check for a memory leaks in your application you should
check Rico Mariani's blog and especially the entry about examianing
application memory.

http://blogs.msdn.com/ricom/archive/2004/12/10/279612.aspx

If you are looking for a memoery profiler check out the .Net profiler
available from MSDN, it's free

1.1

http://www.microsoft.com/downloads/details.aspx?familyid=86ce6052-d7f4-4aeb-9b7a
-94635beebdda&displaylang=en


2.0

http://www.microsoft.com/downloads/details.aspx?FamilyID=a362781c-3870-43be-8926
-862b40aa0cd0&displaylang=en


Another great profiler is Ants .Net Profiler, this will give you a 2 week
eval period.

http://www.red-gate.com/products/ants_profiler/

HTH

Ollie Riches

> Hello Ollie,
>
[quoted text clipped - 49 lines]
> >> ---------------------------------------------
> >> [Sam Samson] - There is no greater folly than fixed price quoting.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.