Options for Memory Management
Selecting memory allocation functions is an important step in the design of an application for Microsoft Exchange Server. You can choose from several strategies when selecting a design for memory allocation. Important considerations include the following:
-
Memory allocation strategy may be determined by the interface you use for development. For example, MAPI functions such as PrepareRecips and ResolveNames require the use of MAPI allocation functions. You will need to consider other development options if these allocation functions do not meet your needs.
-
Memory allocation can have a great effect on performance, depending on the type of application and the memory allocation strategy. Negative effects can result from serialization of critical sections, fragmentation of heaps, repeated allocations, and overhead.
-
Memory allocation strategy differs according to the type of application you are developing. For example, performance is very important to a service that is tied to the scalability and performance of Microsoft Exchange Server itself, and less important for the interactive functions of a client application.
-
Memory allocation sometimes results in memory leaks.
-
Multithreaded applications and multiprocessor systems require special consideration for memory allocation.
-
Client applications may need to run on both 16-bit and 32-bit systems.
Serialization is an important consideration when choosing memory allocation functions. It occurs when a process must lock out all other processes while a critical section executes. This means that one process must complete all its transactions before the next process begins.
When a large number of such critical sections try to access a process at the same time, performance is affected. Such a process is said to be serialized. Serialization is a rate-determining step — a factor in computing the rate of throughput. If all the processes in a system must spend time in a memory allocator, the performance of the system as a whole is determined by the performance of the memory allocator.