Jim Pike

Jim Pike

  • NA
  • 1
  • 15.6k

CloseEnhMetaFile and ERROR_NOT_ENOUGH_MEMORY help!!!

Jan 21 2011 12:04 PM

Here is the basic issue/structure of our system.  We have a webpart that calls up an aspx page with C# code behind.  The C# code calls a web service (remote dlls, not asmx) and the services then call our other dlls. Both the service and "engine" dlls are C++.   All the relevant code is attached in a word file, with the full files as well. 

 

Now the issue. The above all works great in a single user instance, but when I fire up LoadRunner and hit it with 25 users it falls over in about 15 minutes. The line that bombs is HENHMETAFILE hemf = CloseEnhMetaFile(hDC);.  It returns NULL and GetLastError() returns ERROR_NOT_ENOUGH_MEMORY. This of course leads me to believe that there is a memory leak somewhere in the code and that maybe I am not releasing something that I need to.

 

GdiView.exe doesn't show that I am losing any GDI object or METAFILE DCs, and nothing I have tried has given me much of a clue as to what I am doing wrong.

 

Any help you can give would be GREATLY appreciated. I have posted on MSDN and a few other forums but so far no luck in getting any help.

 

The systems involved are all running Windows 2003 R2.

 

Thank you for any help you can give or even a point in the right direction.

 

Apologies in advance if I posted too much code or info. I just wanted to give the clearest picture of the situation.


Attachment: Code.zip

Answers (1)