What is your computer doing with all that memory? Write your own memory browser

  What is your computer doing with all that memory? There are various kinds of memory allocated and used in each process. These include: ·         Managed memory (VB.Net, C#, managed C++) ·         Heap memory ·         Stacks ·         Images (files loaded into a process)   VirtualAlloc is the basis of these allocations. If a process needs…

1

Its easy to create a graph of memory use in Excel

In this post Examine .Net Memory Leaks I showed how to find a .Net managed memory leak.   Now let’s create a graph of memory and resource use over time.     Start Visual Studio 2008, File->New->Visual Basic (or C#) Windows, WPF application. Dbl click the WPF form to get to the Xaml.cs or Xaml.vb…

0

Process Explorer and Process Monitor can help you understand a program

Process Explorer and Process Monitor are must-have free utilities that you can download from http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx   For example you can use ProcExp to examine a particular behavior of Visual Studio.   Start Visual Studio (any version). I was using VS 2008.  Start Process Explorer (as Administrator) Click on the Devenv.exe process (the main VS process)…

0

Stack overflow, expand your stack? Change your algorithm!

In the last post, Area fill algorithm: crayons and coloring book, I showed a program that emulates a kid drawing in a coloring book.   However, the algorithm wasn’t very efficient, and would explode even if you had a simple drawing: it was using the stack to store where to go.   The heart of…

1

Overload Operator new to detect memory leaks

There are various leak detection methods for memory allocators. A popular one is to tag each allocation with some information about the caller. When there’s a memory leak, you just need to look at that tag info to find the line of code that allocated the memory.   However, this requires that the caller pass…

5

Examine .Net Memory Leaks

Writing programs using .Net is very productive. One reason is because much of memory management is “managed” for you. In C, C++ and other “native” languages, if you allocate memory, you’re responsible for freeing it.  There were stopgap measures, like destructors, SmartPointers and reference counting, which helped, but were still cumbersome.   Foxpro manages memory…

8