I have a WCF Service was uses the HTTP protocol. When a particularly large query hits the system, it creates a large Byte[] that leads up through buffers to HttpChannelListener and eventualy to the Service Host itself. This stays there even after the WCF transaction completes. This in turn causes Large Object Heap fragmentation which eventually causes the application to throw an OOM exception.
Here's the path to the Byte[]: ServiceHost.channelDispatchers.items._items[0].listener.innerChannelListener.typedListener.bufferManager.innerBufferManager.bufferPools[13].pool.globalPool.items._array[0]
The system uses buffered WCF communication for transactions to ensure that it's reliable.
Is there anything I can do to prevent these large objects from staying in memory?