September 2003 - Posts

Memory Mystery.

Generous Memory Allocation

Unless memory is in short supply, the OS allocates each running application more than the minimum physical memory required for it to run. The OS commonly give applications like Word and Excel more than a 'just get by' memory allocation. It is just as generous with the memory it allocated to our .NET applications.

Windows OS - If physical memory is not in short supply, the OS will give applications more or less all the RAM memory they ask for. When demand for memory exceeds supply, the OS will take back physical RAM from an application that is not using it to give it to an application that needs it.

CLR - If memory is not in short supply, .NET applications may use more memory than they need. A good example: when a .NET application is loaded into memory, assemblies are loaded in what is a fairly expensive but transient operation. After the assemblies are loaded and if memory is not in short supply, the leftover unused memory from loading the assemblies is left behind rather than being reclaimed.

Source :  Today's Devcity NewsLetter by Mike McIntyre.

More on “Working Set, Minimum Working Set, and Maximum Working Set” too. Interesting Concepts. Also there is a very interesting fact on the OS trimming memory alloted to applications while minimising an application after loading. I tried it out and the change is mind blowing. He also gives the reason on why this is bad idea to implement this in an app just after loading.

It is possible to reduce the working set size of a .NET Windows Forms application by minimizing and then maximizing the application immediately after it loads. Windows OS trims the working set of applications when they are minimized. The memory that was briefly used while loading all those assemblies mentioned earlier is trimmed by the process of minimizing and maximizing the application.

Really good read. Check it out to know some more on Memory Management in .NET. Also dont miss to read the demonstration part ;)

Link Interface 15.

Lots and lots of work lately and barely finding time to keep up with what's happening ... that too with PDC coming along, the amount of information that's been circling around on Avalon, Indigo, Longhorn has been mind blowing ... Lots of good articles and blog entries have also been posted lately.. Here are some of them ..

  • CodeProject has some awesome articles as usual !
  • A new design pattern for a Simple Inference Engine here.. Really cool.
  • Robert Hurlbut talks about SQL injection ... Pretty informative !
  • Mark Michaelis talks about The Meaning of Avalon.
  • Alan Dean aggregates the PDC sessions on 'Avalon' ..
  • Check out this story by Mark Jo Foley on NUI Platform foundation in Longhorn.. Speech API, handwriting, natural language and even machine learning is included as part of the “Natural-User-Interface” .
  • Wesner Moise talks about “Hope for Delegates in Whidbey” ... hmm a very interesting post sure enough ! He asks support for immediate mode edit and continue for VB, better interop with the unmanaged world, enabling most of the C++ features in the managed world, multiple inheritance in the whidbey version. I doubt whether multiple inheritance will be supported at all after hearing the answer for that from the CLR God himself :( but oh well i guess managed C++ features and the IDE will definitely improve in whidbey.
  • Jim Meeker points out to a good article by Roy.
  • RSS Explorer - An IE toolbar that scans pages for RSS feed information and makes it easy for you to subscribe to the feeds that it finds. (via Larkware News). Also check out InfoPath 2003 SDK.
  • Source : Artima - Quote : “I've been troubled by some recent discussions about C# and Java language features. Most people in the discussions seem to lean towards making methods non-virtual by default. Let's reconsider that. (From Michael Feathers' Weblog)“
  • There is a coding competition being held at TopCoder which is being sponsored by google. ( via Kuro5hin ). It is called Google Code Jam 2003 .. hmm sounds interesting but the registrations have not yet started ...
  • I read about this in the paper today and Kuro5hin has an article about “Electronic Paper” ! WOW ! What coincidence ..
  • Quote of the day : Sir Arthur Conan Doyle - '...when you have eliminated the impossible, whatever remains, however improbable, must be the truth'

Link Interface 14.

Lots of work and no time to even catch some good read nowadays ... I know that i am not the only one getting worked out but hey

  • Check out this tip on a feature in Yukon by Tim Sneath !!
  • And Don talks about writing Indigo code in Longhorn .. hmm ..
    • Don : I was getting comfortable writing Indigo code on Longhorn in preparation for PDC.
  • Sam gives his list of tools that he uses very often.
  • Fowler talks about the power of XSLT !
  • MSDN Magazine: