Massive memory leak in WinCE Web Service ???
From: Tim (tanisdaman[remove)
Date: 06/01/04
- Next message: Steven Burn: "Re: Request.Update to Re-Number Recordset Prob."
- Previous message: Kris Eiben: "Re: Drill Downs"
- Next in thread: Egbert Nierop \(MVP for IIS\): "Re: Massive memory leak in WinCE Web Service ???"
- Reply: Egbert Nierop \(MVP for IIS\): "Re: Massive memory leak in WinCE Web Service ???"
- Reply: Steve Maillet \(eMVP\): "Re: Massive memory leak in WinCE Web Service ???"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Jun 2004 08:01:06 -0700
Hello all! I am at my wits end and need a sanity check.
I am using WinCE.NET(4.2) on an x86 platform to host a very simple ASP web page that draws a Bitmap (the BMP comes from an EXE COM server). Everything seems to work great except the BinaryWrite method of the ‘Response’ object is leaking like a sieve.
Each time the web page is drawn ~120K(the size of the BMP) of memory will be leaked. If I comment out the call to BinaryWrite the memory leak goes away.
It looks like BinaryWrite is making its own copy of data, but never seems to free it.
Am I doing something wrong? Am I going crazy (quite a possibility)...
Any help will be much appreciated!
-Tim
The asp code:
<%
Set oMyObject = CreateObject("MyServer.MyComObject.1")
RawData = oMyObject.GetData
Response.BinaryWrite RawData
%>
The C++ COM code:
STDMETHODIMP CMyComObject::GetData( /*[out,retval]*/ VARIANT* pVarVal)
{
pVarVal->vt = VT_EMPTY;
DWORD nHeight = 400;
DWORD nWidth = 100;
DWORD nArraySize = nHeight * nWidth * 3;
SAFEARRAYBOUND bounds;
bounds.lLbound = 0;
bounds.cElements = nArraySize;
SAFEARRAY* psa = SafeArrayCreate( VT_UI1, 1, &bounds );
if( psa )
{
BYTE* pByteData;
HRESULT hr = SafeArrayAccessData( psa, (void**)&pByteData );
// put data into array
hr = SafeArrayUnaccessData( psa );
pVarVal->vt = VT_ARRAY | VT_UI1;
pVarVal->parray = psa;
}
return S_OK;
}
- Next message: Steven Burn: "Re: Request.Update to Re-Number Recordset Prob."
- Previous message: Kris Eiben: "Re: Drill Downs"
- Next in thread: Egbert Nierop \(MVP for IIS\): "Re: Massive memory leak in WinCE Web Service ???"
- Reply: Egbert Nierop \(MVP for IIS\): "Re: Massive memory leak in WinCE Web Service ???"
- Reply: Steve Maillet \(eMVP\): "Re: Massive memory leak in WinCE Web Service ???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|