Snippet: Enable Low Fragmentation Heap for all heaps

来源:互联网 发布:网络作家协会 编辑:程序博客网 时间:2024/06/07 21:37

From matteozan.it

 

The following code is a code snippet that enable the LowFragmentation Heap for all heaps. Remembers that a process has at lastone heap but for example a CRT console application has practically atlast two heaps. The first heap is default heap of process and thesecond is the CRT heap. If you use a lot of external DLLs is verycommon that one of this DLL allocate a private heap.

* FLH is useful if a program use intensively Heap memory for a long time, this is the case of a Server application like MySQL.
* This settings is made by the program and affect only itself not all system.

Anyway LFH is enabled by default in Vista.

    

Suggested reading Windows Internals 4th edition for more details.

原创粉丝点击