.NET Memory usage – A restaurant analogy

My favourite author Simon Singh is a wiz at analogies. In his book The big bang he explains concepts like the doppler effect and the theory of relativity using analogies with frogs and trains that makes it not only easy to understand but you will remember them forever because of the picture they paint in your head.

The other day at work I heard one of my colleagues explaining memory usage and why you get out of memory exceptions to one of his customers using a restaurant analogy.  I've talked about OOMs and memory management in an earlier post but I found the analogy so amusing that I thought I'd share it (and yes, before you say it, i do admit i might have stretched the analogy a little too far:), and that it doesn't hold a candle to Simon Singhs analogies, but then again he sells books and i just rant in a blog...).

Disclaimer:  In order to not get too longwinded I will simplify a lot of things, and say that for example the GC allocates 64 MB segments even though this differs between different framework versions and the size of the objects you allocate (read large object heap). Some other details are also dependent on configuration settings (i.e. using the /3GB switch etc.) but I will exclude such details from the analogy.

Analogy Part 1 - General memory usage

If you have read my earlier posts you will know that a process on a 32-bit system can typically address 2 GB of virtual address space. This is the memory that you have to work with, independently of how much RAM you have.  More RAM is good for performance since you page less with more RAM, but it doesn't do anything to expand the 2 GB address space.

Picture this 2 GB address space as being the floor space of a restaurant.

When you allocate an object (whether it is .net or non-.net) you typically follow a two step process.  You reserve the memory and then you commit space inside your reservation.

The reservation is equal to reserving a table at the restaurant.  And just like in a restaurant, depending on the memory manager you use (we will get to that later) you will reserve the memory in chunks.  Let's say for example you are a party of 3. It is not likely that there will be a table for 3 in the restaurant, but rather you would get a table for 4 out of which you use 3 seats and waste one seat.  

In memory terms the space for the table you have reserved is called reserved memory (virtual bytes), and the actual space you use (for the 3 seats) is comitted memory (private bytes).   The floor space that is not yet reserved is free memory.

On a pretty good restaurant night your restaurant/memory might look something like this where the blue areas are reserved space, red means committed space and white is free space.


Now, if someone calls in to make a reservation for 3 they will get the answer that the restaurant is full, since the only way to seat 3 people together is to seat them on a 4 seat table.  Even though you could fit in two 2-seat tables that wouldn't be good since they all want to sit together.

Similarily when you make memory allocations you won't split a memory reservation out into different locations, it has to be allocated in one chunk or not at all. So the memory result in this case would be "out of memory", even though there is plenty of space left.

An observant person might also note that if we put the tables closer together so that they are completely side-by-side you could easily fit in a new table of 4, but reserved memory areas much like tables at some restaurants can't be moved.

When we talk about memory fragmentation we either talk about the free but unusable (because it is not large enough to fit a new table) we have, or how much of our reserved memory we are not using (difference between virtual bytes and private bytes).

Analogy Part 2 - The .NET GC

Most of the time when you create objects in an application, whether it is .NET or not you use some kind of memory manager (NTHeap, C++ Heap, GC etc.), and in the restaurant case you can think of the memory manager as an hostess that reserves seats for you and ushers you to the location where you are to be seated.  For example if you call malloc you don't have to provide an address where you want your allocation to lie, instead you say that you want memory of a certain size and malloc returns, ok, you will be seated at table 1 in the "C++ heap" area.

The .NET GC takes this one step further and pre-reserves a large table for anyone who might want to use .NET objects in the process (let's say a 64 seat table).  And when anyone creates a .NET object, the GC ushers them to the next available seat on that table.  Once in a while the usher will walk around the table to check if someone is done eating and ask them to leave, and then scoots the rest of the people down the table.   Some people might be waiting on other people to finish up before they can leave (references), so they get to stay too. And some people may be really annoying and say, dude, i got a window seat, i am sooo not moving (pinned objects) which means that the rest of the people can't be scooted down towards the end of the table either.

Any empty seats between people are referred to as .NET memory fragmentation.

Once the 64 seat table is filled up the GC needs to reserve a new 64 seat table if it needs to accomodate newcommers, and if it can't you will get an out of memory exception.

But, how does it really look

Ok, enough with the analogy, here is what memory looks like in a real ASP.NET application


Again, the red parts are committed memory, the blue parts are reserved memory that is not committed and the white space is free space.

The dots you see towards the end of the memory space are probably dlls, and although just like in the restaurant scenario there is a lot of white space, it is likely that none of the gaps between the small red dots are large enough to house a 64 MB segment and thus the next time we fill up a GC segment and need a new one to accommodate a new object, we will get an out of memory exception.

The reason these small red dots (dlls) are spaced out like this is because they are loading at the prefered base addresses for those particular dlls.  You can't really do much about that type of fragmentation since it is hard to know in advance what a "good" prefered base address would be, but what you can do something about is finding out where the memory you are actually using is going.

A comment on performance counters and how not to use taskmanager

Throughout the analogy I talked about private bytes and virtual bytes and these are the two most important performance counters to look at when defining memory usage or memory leaks. 

There is another counter called working set which simplified consists of how much memory is in the memory pages that are currently or was recently touched by threads in the process or approximately, how much of the memory that is used by the process is currently in RAM.  The working set counter might be interesting if you have issues with too much paging and many processes on the same box competing about the RAM, but in order to determine how much memory you are using (reserved or committed) it offers little or no help.

If you want to see this in action, you can create a winforms application and allocate a bunch of objects and see the workingset go up, and then if you minimize the app, the working set drops.  This doesn't by any means mean that you have just released all this memory. It just means that you are looking at a counter that is totally irrelevant for determining how much stuff you store in memory 🙂 Yet... this is the counter that people most often look at to determine memory usage...   

I know that by now you are probably thinking "yeah right", you haven't even heard of this counter before, why would I say that this is the counter most people look at???  The answer is, because most people use task manager to look at memory usage of a process, and specifically look at the Memory Usage column. Surprise surprise:) what this actually shows you is the working set of the process...

If you want to see private bytes which is a far more interesting counter, you sould look at the column in task manager that is labeled Virtual Memory Size (yeah, that's really intuitive:)), or better yet, look in performance monitor at processprivate bytes and processvirtual bytes, there is no reason not to if your intent is to investigate high memory usage or a memory leak.


So tonight, go out, grab a bite to eat and see memory management in action:)  I bet you will probably find a lot more similarities than the ones me and my pal came up with...


Comments (58)
  1. DuncanS says:

    Where do you get those  memory map pictures?

  2. Tess says:

    I knew that if I would get one comment on this post, that would be it:)  

    One of my colleagues wrote a sample a long time ago that parses the output from !vadump and displays it in this way.

    Unfortunately I can’t share the tool for different reasons, but the output from !vadump (in windbg) looks something like this if you want to write your own parser…

    0:000> !vadump

    BaseAddress:       00000000

    RegionSize:        00010000

    State:             00010000  MEM_FREE

    Protect:           00000001  PAGE_NOACCESS

    BaseAddress:       00010000

    RegionSize:        00001000

    State:             00001000  MEM_COMMIT

    Protect:           00000004  PAGE_READWRITE

    Type:              00020000  MEM_PRIVATE


  3. George says:

    Thanks Tess!  That was great.  But now I’m hungry . . .

    But seriously:  Why does Task Manager show private bytes (and why call it Virtual Memory?) and not give any option to see virtual bytes?  From your article I’d think virtual bytes would be a more useful statistic.   If there are 10 tables in my restaurant and they are all taken up by 10 different parties of 2 then I’ve maxed out my available memory – but this VM Size column would show I’ve only used up 20 seats.  If a process has reserved a ton of space I’d like to know about it – even if no one is sitting there at the moment.

    I expect part of your answer will be to use perfmon.  But I *like* taskmanager because I can get to it quick in a crises, see my processes immediately, and even kill one if I have to.  So it would be nice if it made a little more sense.

    OT:  All your blog entries are pleasure to read.  How about a book?

  4. Andy C says:

    Best description of memory management ever! 🙂

  5. ACWTeam says:

    You’ll be happy to know that on Vista private pages is being shown by default instead of working set.

  6. More on Atlas [Via: James Avery ] Smart Client Deployment with ClickOnce – Final Manuscript Complete!…

  7. Tess says:

    Awesome stuff that vista shows private pages by default, that is really great.

    George:  I hear ya, but it is really not as strange as you might think to call it virtual memory, after all it is committed virtual memory (and to not get endlessly long column names it is listed as just virtual memory).  

    I do agree with you that virtual memory is a ver important counter to look at (yes, unfortunately it is only available in perfmon), but in most memory cases the virtual/private bytes difference is not the problem, so looking at private bytes will give you a very good indication if you have a problem or not. (For example, in most asp.net apps around 1 GB private bytes, the virtual bytes will be ~1,5 GB and it is hard to get a ratio much smaller than that).    So for quick stuff, look in task manager for virtual mem, and for real investigations, look in perfmon at both virtual bytes and private bytes.

    The other thing is that if you look at a memory dump for example, the only thing that will help you recognize who is using the memory is by looking at the committed mem.  after all, the mem that is reserved but not committed contains no data, its just uninitialized space or garbage.

    Having said that, there is ways to track who owns virtual bytes that are not committed. The way to do this is to use a profiler or inject a dll into the process that hooks up to calls to virtualalloc and logs the stack anytime this is called, and then removes them when the space is deallocated.  

    One tool that does this is a tool that we use in support called debugdiag http://www.microsoft.com/windowsserver2003/iis/diagnostictools/default.mspx


  8. nativecpp says:

    Hi Tess,

    Very good article. A question on your example of table:

    From the pic (table), it seems that all tables contains at least one red (committed).  How can the following statment be true since you can’t split the reserved into two different area:

    "Even though you could give fit in two 2-seat tables that wouldn’t be good since they all want to sit together. "

    Am I correct or I am missing something ?


  9. Tess says:

    I am not sure I follow…

    In the picture above we have had the following parties along with the types of tables they were assigned to

    party of 1 – 2 seat table

    party of 4 – 6 seat table

    party of 3 – 4 seat table

    party of 2 – 4 seat table

    party of 4 – 4 seat table

    party of 1 – 4 seat table

    It would have been more economical when it comes to space for the last party of 1 to sit at a 2 seat table instead of a 4 seater, but picture it like this…

    you call in for reservations, hostess: how many are you? you: not sure, i think we’ll be 7…   so you get a table of 8, and then some of your pals never show up, but now you are already seated at a table of 8.   Similarily in the managed world you sometimes over reserve.


  10. Petros says:

    I am really glad that there are not any real restaurants with GC-hostess. Why? I am a slow eater and I would not like to change seats during my meal.

  11. Padma says:

    Great blog.

    I have some questions on the memory counters –

    If the difference between the Private bytes and Virtual Bytes is high , does that indicate a problem? In our managed process we see that the private bytes is 250 MB whereas the virtual bytes is 500 MB. Does this mean there is some sort of fragementation?

    One more question, some of the code pages of the base dlls are shared across the process right, will those also show up in the Committed memory of a process i.e. private bytes?

    If working set is the pages recently used by the process , why do we sometimes see that Working Set Size (memory usage column in the taskmgr) is greater than the private bytes?

    thanks , Padma

  12. Tess says:

    Thank you Padma,

    It is fairly common that there is a difference between virtual and private bytes (up to around 500 MB or so if memory usage is high).  For example at the start of the process we will have one small object segment (around 64 MB) and one large object segment (around 16 MB) per processor (for server GC).  If these are not filled with data yet, virtual bytes will be a lot higher than private bytes.  Similarily dlls dont fit perfectly into the chunk sizes that can be reserved etc.   so I would start looking at VM fragmentation if the virtual bytes start increasing independently of private bytes or if for example you start getting out of memory exceptions at 300-400 MB.  Then you have a problem of someone reserving a lot more than they need.   If your app is purely managed, this is generally not something you have to worrry about since you don’t have any custom components that would make unneccessary reservations.  One thing that does waste virtual bytes though is having debug=true in web apps.

    Private bytes are only private bytes so no shared bytes show up.

    Finally, working set contains shared bytes.


  13. nativecpp says:

    I must be missing something. As you stated, blue areas are reserved space, red means committed space and white is free space. If I want to make a reservation, GC would need to use the white space to setup a table for me, right ? GC can’t use the blue areas since they are reserved and can’t fill in the request in some of the empty slot of the blue area ? I guess I misunderstood that you were talking about the blue area.


  14. Tess says:

    Hi NativeCpp:)

    You are right in that the GC would need to use the white space to set up a table.  What happens is that the GC allocates its memory in chunks and committs out of it.

    For example, at startup of a .net process (server GC) you get one small object heap segment (64 MB) per processor for managed objects.    This is reserved and "owned" by the GC.   When you do:

    MyClass s = new MyClass();

    rather than having to reserve a new slot on some heap, the GC uses it’s reserved memory and committs memory out of it.  In other words, the GC has a large blue table (reserved), and when you create a new .net object it seats you and marks it red (committ).

    In the Native C++ world this would work a little differently i believe since virtual memory for C++ objects is not reserved ahead of time, but rather when the object is actually created.  

    The differences between the C++ world and the .net world are so large that they are almost apples and oranges.  In the C++ world you manage the memory yourself (taking care of how much you need to allocate/reserve to fit an object, and taking care of when to remove stale objects), in the .NET world the GC does this for you.  

    The problem in the Native world when it comes to memory leaks is often forgetting to free mem, or loosing a pointer to a memory area.

    In the Managed (.net) world those kind of memory leaks would rarely or ever occurr.   Rather, the memory issues that occurr in the managed world are because you hold a reference to an object, keeping it alive a lot longer than you are meaning to.

    I know I strayed away a little from the original question in the end but hope it helps

  15. padma says:

    Thanks for you response. Could you explain me the Server GC and do we get any added benifit using this?

  16. Tess says:

    Hi Padma,

    There are a lot of articles about the GC on MSDN, but one blog that specifically deals with the GC and does so quite well is http://blogs.msdn.com/maoni/archive/2004/09/25/234273.aspx

    Where the different GC flavours are described.

  17. nativecpp says:

    Thanks for the additional clarification. I agreed with you that native C++ and managed are totally different as far as memory is concerned. I also agreed that in managed world we are more concerned about memory rentention than leak. One of my daily activities (weekdays 🙂 )is to read your blog.

    As for your previous articles on debugging memory issues using SOS, they are good. But I would love to have some ‘real’ or ‘tough’ cases where you need to dig deep to ioslate the problem.

    Keep up the good work.


  18. Zeng says:

    Test, great analogy. A question I haven’t been able to find answer to is: which memory memoryLimit in machine.config is about?
    – If it’s private bytes then is GC aware of this limit to collect memory more often when it’s approaching this limit?
    – If it’s virtual bytes then is GC aware of this limit to stop itself from over allocating when it’s approaching this limit?


  19. Tess says:

    Hi Zeng,

    The memory limit in machine.config is only for ASP.NET and it is based on the amount of private bytes in the process.   The GC as such is not aware of it, but ASP.NET is and will purge the cache when you get close to the limit.  Allocations can still happen but once you reach the limit the process will start a recycle.

  20. Zeng says:

    Tess, thanks for responding.  I don’t know what “the cache” you referred to is, could you explain here? And if I understand you correctly there is a great chance that the process gets recycled just because GC does collect often enough especially when a big tree of nodes are waiting to be colllected, is that right? Thanks again.

  21. Tess says:

    The cache I am referring to is the ASP.NET cache.  The memory limit is only applicable to ASP.NET applications, it does not apply to winforms apps or windows services.

    If it is a winforms app or windows service there is no recycling.  If the process "crashes" it won’t start up again automatically.  If it is an ASP.NET app it will be recycled when it reaches the memory limit.  This doesn’t have anything to do with how much the GC has to do.

  22. Fredrik says:

    Great, and entertaining, article!

    I am having a situation where my application has about 70Mb in privates and >300 Mb in virtual bytes, similar to other comments here.

    When looking a bit in windbg I find that MEM_IMAGE (RegionUsageImage) corresponds to almost 200Mb. At a glance this seems to be related to dlls and such that are used by the application. Is this a normal size for these objects?

    Can anything be done to reduce the amount?

  23. Tess says:

    Hi Fredrik,

    Depends on what you consider normal for your application.  If it is 200MB virtual for dlls I wouldn’t be too worried but you can run lm to look at the dlls that you have loaded to see if there is a lot that you dont expect.  Then you can run !dumpdomain to see the assemblies for each domain and !dumpdynamicassemblies to see the dynamic assemblies.  If you have a lot of those you should look into it (see previous posts on dynamic assemblies/XMLSerializer).  

    Also if it is an asp.net app, check that you don’t have debug=true in your web.configs.  But overall, 70 MB private bytes is pretty small so I don’t think you have a problem with dlls based on that.

  24. Morgan says:

    I am using Vista RC1. It is shown as "Memory(Private Working Set)" in task manager, but the value seems have no relationship to private bytes, virutal bytes or working set in perfmon at all.

    Perhaps it is correct in RTM.

  25. Tehnoon says:

    That is absolutely amazing dude! Excellent excellent stuff!

  26. Jaaloor says:

    I have a question. We encoutner troubles (you’ll see it’s normal we do when I’ll have finish explaning what we are trying to do 😉 with a .Net appliation. We have an application that stores document for users. We upload documents into the http request, to do so we modified the maxRequestLength parameter in the web.config file of the application. The problem is that we want to allow user to upload documents up to 100Mb (yes I know but I am asked for a miracle !). the result is that sometimes we can add such big documents and sometimes we can’t. The server as loads of physical memory.

    The thing is that the memory usage for the application never exceed 500Mb or something like that. I fear that when the upload fails it is because it starts to store the request in the memory and at some point don’t find any free contiguous memory slot to keep on loading the request. I would expect that it reserves all the memory when the request arrives.

    If anyone has any idea regarding this issue I would be very thankfull !

  27. Jaaloor says:

    thanks for your quick answer !

    In fact that is exactly What I try to make understand to my customer but still they first want me to do a miracle …

  28. Jaaloor says:

    thanks for your help.

    In fact that I try to say to my customer for the whole week 😛 one more evidence helped me to bring him to reality 🙂 now we’re going towards a realistic solution 😛

  29. Veremos de firma simple y didáctica como funciona la asignación y administración de memoria de Windows y .net.

  30. Alex says:

    Tess I think your great (I had a fortune of getting help from you on number of support cases and you are definetly one of the best MS support engineers I worked with).

    Does microsoft (perhaps internally) has a utility that can analyze some of this stuff automaticly? If you have the dump then I am sure alot of these problems can be diagnosed automaticly. Or am I over simplifying here?


  31. Tess says:

    Hi Alex,

    First off, thank you very much:) that makes me blush:)

    We are working on scripts for automating some parts of .net debugging.  You may be familiar with a tool for automation of native debugging called debug diagnostics 1.1.  In essence we are looking into what we can do as far as writing scripts for that for .net debugging, but there are some parts, especially memory wise that are a bit hard. For example figuring out which objects are interesting to look at based on the !dumpheap -stat output and then determining what roots are interesting since the job is based on a lot of trial and error.

    It is fairly easy to write scripts on your own for debug diag (vbscript files) and a good start is to write one that prints out output from !dumpheap -stat, !dumpheap -min 85000, !eeheap -gc, ~* e !clrstack, !threads, !dumpdomain, !syncblk and ~* kb

    If you just create that "simple" script it takes you a long way into seeing what is going on in most cases, and writing the script is as easy as writing

    Manager.Write g_Debugger.Execute("!dumpheap -stat")

    in one of the scripts in the debugdiag scripts folder (of course you have to make sure to load sos first).

    Before we have anything that is usable in a more general sense it might be a while, but as soon as we do, I will post it on the blog.

  32. Jes says:

    Hi Tess,

    Great stuff!

    I am trying to figure out how much RAM our .NET app. is actually using and used your recipe above monitoring with Private and Virtual bytes with PerfMon. This seems to make sense, BUT:

    1) Why is page file constantly growing, when their is sufficient with RAM left? It grows with app. the same size as RAM being used. Has it something to do with Virtual memory always requires disk??? (I am blank :-)))

    2) Why is a high RAM usage "maintained" even after data has been discarded? (first I complete heavy search, then complete less heavy search…dataset is nulled each time) I would expect it to go down immediately.

  33. Li Xiong says:

    The hierarchy in flat memory: Heap and Stack This section discusses Heap, related heap corruption/memory

  34. I was working through the High CPU Lab Review which is basically caused by high CPU in GC. To understand

  35. Amol says:

    Tess, that’s a wonderful way to explain memory management. I had a query about the following statement though.

    "When you allocate an object (whether it is .net or non-.net) you typically follow a two step process.  You reserve the memory and then you commit space inside your reservation."

    In context of .Net memory management, when is that we reserve the memory and when is it commited. Can you please elaborate?

  36. Tess says:

    memory on the .net gc heaps are reserved in segments so everytime you fill up a segment and need more space you would reserve a segment which might be for example 16 MB, 32 MB, 64 MB or even larger depending on framework version, GC mode, OS architecture etc.

    Either way, you reserve the 64 MB for example but you wouldn’t commit memory inside them until you actually allocate a new .net object.  Now if that .net object was just 2k then you would have ~64 MB reserved and 2 k committed… if you allocate another 3k object you would then have 64 mb reserved and 5k committed etc. etc.

  37. Danp129 says:

    Thanks for writing this.  

    For everyone that doesn’t like Task Manager, try Process Explorer, it’s free and it shows all the memory info you want and has tons of features.


    I recommend the full suite or atleast looking at each app in the suite and choosing what you like.

  38. Murali says:

    Hi Tess,

    Its an excellent article on memory management. Is there any way to identify the memory being consumed by DLL’s used.

    For ex:

    A MOSS application has many third party webparts and controls and http handlers. How can we isolate which webpart or which control is taking more memory.

    Because I have observed that application stops serving some of the HTTP handlers until we do a app-pool recycle. Then immediately that handler works and serves the requests and again stops after some time…

  39. Tess says:

    There isnt really a way to record memory allocated by dll (assuming you mean memory allocated by the code in that particular assembly)

    You would have to do a normal memory investigation, check out some of the labs around memory (on the right hand bar) to see how you can do memory investigations…

  40. Jonathan says:

    I stumbled upon your article doing a Google search for why Task Manager didn’t reflect the correct memory usage. When adding the memory usage for 6 processes it would be up to 8GB and the server only has 3GB! Your article really cleared things up for me by explaining the difference between private bytes & virtual bytes. I’m still not sure how those processes can amount to 8GB but thanks for writing this article!

  41. Tess says:

    while you only have 3 GB of RAM that doesnt mean that the combined memory usage for your processes can’t be more.  Any memory that doesn’t fit in RAM will be swapped out to disk in page files

  42. Linki, które posłużyły mi przy tworzeniu prezentacji, z których czerpałem wiedzę, nakładałem ją na to

  43. Hemal says:


    I have a problem…

    Please help me out.. i m using asp.net 2005 and my application is to uplaod multiple images on the server, but it gets crash down when multiple user tries to uplaod images. the error is like this

    aspnet_wp.exe  (PID: 3040) was recycled because memory consumption exceeded the 609 MB (60 percent of available RAM).

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Means something related to memory, server is having 1GB RAM..

    Please help me out, i m stuck………….

    Thanks in advance

  44. Tess says:

    you might want to read through


    Regarding the 60%, this is the default setting for 1.1 in machine.config,  you can change it if you dont want it to recycle at 60% of RAM size, but you will probably get out of memory exceptions if your images are very large

  45. Josh says:

    I was just reading through this post and marveling at the simplicity and elegance of the explanation, after which I happened to scroll back up to the top.  It took me a couple of moments to realize that’s probably a picture of the writer up at the top of the page.

    So you have someone walking around with that kind of brain power that also looks like that?!  Tess is either a mythical avatar that can’t be found in nature or she won the gene pool lottery.

  46. Amjad says:

    Good article, here i want to relate it with my scenario.

    I initialize all the object, which will be needed, in advance and put them in a map and i return the clone of object on demand.

    I want you to shed light on this approach and what to know is there ever a chance of memory leaks in this scenario. Thanks

  47. JC says:


    Really great article.

    I have a query may be you can help.

    In our application we create big arrays of the size

    float[] abc = new float[65000] many such arrays are created. As many as 512 or 1024. We get outofmemory exception frequently.

    The problem is even if we set these arrays to null memory is not released.

    We doubt that GC is not reclaiming the memory.

    We did memory profiling using some tools then the tools shows that the arrays are removed.

    Can you suggest something for this problem.

  48. Tess says:


    Because of the size these will end up on the large object heap which is not garbage collected as frequently as small objects.

    Depending on framework version etc. and allocation pattern you may also be causing some significant fragmentation on the large object heap here.

    The GC should collect them if they are ready to be collected the next time a full GC is initiated.

    I am thinking the reason for your OOMs is probably that you allocate a lot of these at the same time (i.e. their lifetimes intersect) and my best advice to you would be to make them slightly smaller so that they dont end up on the large object heap.    Monitor the perf counter for LOH to see how much you allocate on the LOH.

  49. Sandeep says:

    Hi Tess

       Great article! But the memory map pictures are not loading on this page…can this be fixed?


  50. Sandeep says:

    Hi Tess

     Great article….but the memory map pics are not loading on this page….can this be fixed?

  51. Tess says:

    sandeep, are you talking about pictures?  I can see the pics fine, do you get an error of some kind?

  52. sandeeparora says:

    For me, either in IE or Firefox, it just shows a [x] in those places where images should be loaded…I would appreciate if u can mail them to me at this Id : sandeeparora_1704@yahoo.com

    Thanks in advance


  53. shamanth says:

    yes the picture does not show up the first time page loads completely. however i was able to see them in IE after couple of refreshes.

    article made it’s point without the images as well. Thanks Tess. Great article.

  54. Milind says:

    Yes Tess,

    The images are not visible, I have IE9 and FF3.5. In IE it simply show 'X' mark and FF, just nothing there !!

    Even after few refresh.


  55. Vivek G says:

    Hi Tess, Thanks for the insightful article. Also looked up the definition of Private Bytes on MSDN "The current number of bytes this process has allocated that cannot be shared with other processes" which seems unnecessarily vague when it could have just said "The current number of bytes actually committed by the process". Do you have any insight as to why they have the particular wording for the definition? Also, would like to confirm that the 2Gb/4Gb threshold actually applies to the Virtual Bytes counter.


Comments are closed.

Skip to main content