Hi
I have a PCIe DMA BusMaster driver which I got from the Xilinx XAPP1052 application note. It’s an older WDM driver used for DMA transfers to and from an FPGA (Asyncronous / Overlapped mode). I’m only transferring data from the FPGA to the PC. The DMA TX buffer on the PC is allocated by the application and a pointer is sent to the driver.
The problem is this:
If I do 1000 DMA transfers (each of 2kB), the kernel memory is also increased with 1000kB according to the TaskManager, Performance tab. If my application continues at this rate, Windows XP runs out of system resources within a few minutes.
If I exit the application before it runs out of system resources, the application still remains in the TaskList.
I belive this is caused by a memory leak in the driver. I have tried with another application using the same driver and it does the same.
I have checked with WinDbg that the driver behaves as expected (as far as I could see from the KdDebug messages) and I was not able to detect any pending IRP’s after the application was closed.
The problem only occours if at least one DMA transfer is done. If I break my application before it starts the DMA BusMaster transfer, but after setting up the buffer address in the FPGA, there is no leak and the application can be unloaded without problems.
Should the DMA BusMaster transfer allocate any memory in the driver during a transfer and how do I eventually free this memory again before issuing the next transfer?
Are the Scather / Gather lists not free’ed when PutScatterGatherList is called?
Any ideas how to find this leak is appreciated.
Thanks in advance
Best regards.
Brian Rasmussen