Posted on 2005-04-25
I'm running IIS 6.0 on Win2K3.
The script below pulls an image out of my (Access) database, I use the asppainter object to set the quality and then I use the binarywrite method to send it to the client's browser. After I run it, the memory usage of the w3wp.exe process increases with about 300KB and it doesn't decrease again. Since this page is called in a loop to display a lot of images the memory increases very fast.
STILLID = Request.Querystring("STILLID")
SQL_STRING = "select STILLDATA from STILLS WHERE STILLID="&STILLID&";"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL_STRING, DB_CONN, adOpenStatic, adLockOptimistic, adCmdText
If Not RS.EOF Then
If Not IsNull(RS("STILLDATA")) Then
Set pic = CreateObject("ASPPainter.Pictures.1")
mypic = RS("STILLDATA")
bdata = pic.SaveToStream
Response.ContentType = "image/jpeg"
mypic = ""
bdata = ""
Set mypic = Nothing
Set bdata = Nothing
Set RS = Nothing