In HttpModule callback, Marshal.AllocHGlobal(size) is ued to initialized a buffer pointer for unmanaged code processing. After processing, use Marshal.FreeHGlobal to free it. But memory leak is observed.
When calling the same logic in a standalone c# application, no memory leak problem.
The code logic is about the same as below: