0

I am currently looking into a performance and memory issue (crash) while performing printing huge documents from my application. I am new to profiling and first time dealing with memory issues.

What I tried so far:

I tried using the Visual studio built in Performance analysis but it was so slow and processing for ever.

Is there a method in C# that I can use that tells me how big the object is like that returns me this objects is xMB or any debugger tools that will convey these details.

While searching I was referred to few tools like Ants Profiler but before taking that path I was wondering is there any built in functionality in C# or VS debugger that can used for my need.

Ajax3.14
  • 1,647
  • 5
  • 24
  • 42
  • Not really. You can see the answer here: http://stackoverflow.com/questions/3057181/ways-to-determine-size-of-complex-object-in-net – Doug Wilson Apr 30 '13 at 14:47
  • @hellfire thanks for the link. So I am curious how people will find out the culprit on a memory crash situation. I am currently trying task manager after every step-in. Is this the way to go or is there any other efficient ways? – Ajax3.14 Apr 30 '13 at 14:53
  • Your best bet really is a profiler. (I too like dotTrace from JetBrains.) There's also this from MS: http://msdn.microsoft.com/EN-US/library/vstudio/system.gc.gettotalmemory(v=vs.100).aspx It won't tell you anything that useful though. – Doug Wilson Apr 30 '13 at 15:09
  • 1
    Not so sure this is at all constructive. You are bound to find out something you already know: the big document is too big. Change your EXE project's Target platform setting to AnyCPU so you can take advantage of the address space available to a 64-bit process. – Hans Passant May 01 '13 at 13:21

3 Answers3

1

I personally like dotTrace from JetBrains. Provides memory and time elapsed type profiling of .NET code. They have a 10-day trial if you want to give it a whirl. You can see it here: http://www.jetbrains.com/profiler/

Tombala
  • 1,660
  • 9
  • 11
1

As advised you might have to use a profiling tool to get the details.

I would personally favorite windbg, but might be too much if its a huge project with dependencies.

Here is a project that could help find your undisposed object: Finding-Undisposed-Objects. Could help you to get closer to identify the problem.

jacob aloysious
  • 2,547
  • 15
  • 16
0

I hope this post isn't too late. One of the new features introduced in Visual Studio 2013 is .NET managed memory analysis from dump file. You can find the post about debugger improvements here http://msdn.microsoft.com/en-us/library/vstudio/01xdt7cs%28v=vs.120%29.aspx#BKMK__NET_Framework_Memory_Analysis_with_Dump_Files

Andre Hamilton
  • 236
  • 1
  • 3