Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been investigating an issue with a production Classic ASP website running on IIS6 which seems indicative of memory fragmentation.

One of the suggestions of how to ameliorate this came from Stackoverflow: How can I find why some classic asp pages randomly take a real long time to execute?. It suggested flipping a setting in the site's global.asa file to 'turn on' Low Fragmentation Heap (LFH).

The following code (with a registered version of the accompanying DLL) did the trick.

Set LFHObj=CreateObject("TURNONLFH.ObjTurnOnLFH")

(Really the code isn't that important to the question).

An author of a linked post reported a seemingly magic resolution to this issue, and, reading around a little more, I discovered that this setting is enabled by default on Windows Server 2008.

So, naturally, this left me a little concerned:

  1. Why is this setting not enabled by default on 2003, or
  2. If it works in 2008 why have Microsoft not issued a patch to enable it by default on 2003?

I suspect the answer to the above is the same for both (if there is one).

Obviously, we're testing it in a non-production environment, and doing an array of metrics and comparisons to deem if it does help us. But aside from this I'm really just trying to understand if there's any technical reason why we should do this, or if there are any gotchas that we need to be aware of.

share|improve this question

closed as not constructive by Greg Askew, John Gardeniers, Scott Pack, Chris S Nov 20 '12 at 15:29

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Windows 2003 was designed 10 years ago. Who knows the driver for default settings design decisions back then? The people involved may not even work at the company any longer. Microsoft also stopped issuing patches for Windows 2003 due to mainstream support ended 2010-Jul-13 - over two years ago. – Greg Askew Nov 19 '12 at 17:46
This question implies that you think we know the reasoning behind Microsoft design decisions, which we don't. Have you asked Microsoft about this? – John Gardeniers Nov 20 '12 at 1:07
@JohnGardeniers Yes, it did imply that, didn't it. Really I was just wanting to understand if there was any known problems issues associated with turning it on. – James Wiseman Nov 20 '12 at 9:52
up vote 1 down vote accepted

In Windows, heaps get fragmented when a poorly-written application allocates memory in an inefficient manner, such that its heap is left in a fragmented state. When an application's heap is totally fragmented, it can no longer make memory allocations, because there is no single contiguous block of memory in the heap large enough to satisfy the request. It's all in little fragments. Even if the sum of the sizes of all those little fragments adds up to enough to satisfy the memory allocation.

Emphasis on poorly written application.

Sysinternal's VMMap is good for viewing the address space of a process and checking it for this sort of fragmentation issue.

Do note that ASLR was introduced in 2008 as well, which does exacerbate this fragmentation issue to a degree. I imagine that had some bearing on the decision to enable LFH by default in that operating system. Also, a LFH policy tends to require more memory up front AFAIK, which may have been more of an issue in the 2003 era than it was in the 2008 era.

To get a more definitive answer than that as to why Microsoft decided to change this policy in 2008, you'll probably have to ask those engineers at Microsoft.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.