Heap fragmentation can cause a server application that is expected to run continuously for many months to suddenly start malfunctioning thinking that it\'s out of memory.
Rather than scheduling your restart based on time or number of requests, you could examine the heap to see when the fragmentation has reached a level when the largest contiguous block of memory falls below a certain level - after all - you'll start to see out of memory errors when not when all memory is used up but when you try and allocate objects larger than the size of the biggest free contiguous space in the heap.
You can use VirtualQueryEx to walk your heap and find the largest free contiguous area. For an example of how to do this, see this article.