andremussche / scalemm

Fast scaling memory manager for Delphi
https://code.google.com/p/scalemm/
Other
98 stars 22 forks source link

Out of system resources, memory isn't freed #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In a ISAPI library under IIS, for each web request make some memory 
consuming task like create TBitmap make some adjustment on it the send back in 
the response.
2. Load test it with JMeter
3. Allocated memory become more and more
4. after a while Out of system resources exception raised, and IIS recycle the 
app pool

What is the expected output? What do you see instead?
Expected to free all allocated memory.

What version of the product are you using? On what operating system?
I'm using 2.14 now, but I've checked with 2.05, 2.12 and with 3.0 also.

Please provide any additional information below.
I've checked my code with FastMM for memory leaks, and it didn't report any. 
I'm using Delphi XE2, and a multicore system.
Sometimes instead of "Out of system resources" I get "Cannot recieve data from 
font" or "Canvas does not allow drawing" messages as well. In the attachment 
you can find the cpu/mem usage in case of 35 concurrent users (WTM.jpg) and 
with 5 concurrent users (WTM2.jpg) and here's a stack trace of the error:

0198c49f ReportService.dll Vcl.Graphics                  OutOfResources
0198c542 ReportService.dll Vcl.Graphics                  GDIError
0198c573 ReportService.dll Vcl.Graphics                  GDICheck
01990cf3 ReportService.dll Vcl.Graphics                  CopyBitmap
019916d7 ReportService.dll Vcl.Graphics                  TBitmap.CopyImage
0199375f ReportService.dll Vcl.Graphics                  TBitmap.SetSize
01992fbf ReportService.dll Vcl.Graphics                  TBitmap.SetHeight

and 

0198c53b ReportService.dll Vcl.Graphics                  GDIError
0198c573 ReportService.dll Vcl.Graphics                  GDICheck
01990eab ReportService.dll Vcl.Graphics                  CopyBitmap
019916d7 ReportService.dll Vcl.Graphics                  TBitmap.CopyImage
01993245 ReportService.dll Vcl.Graphics                  TBitmap.SetPixelFormat

and

01a9ba28 ReportService.dll llpdfttfcodes                 TTTFData.TTFException
01a9a041 ReportService.dll llpdfttfcodes                 TTTFData.LoadTables
01a9a69f ReportService.dll llpdfttfcodes                 TTTFData.Create
01a9fbee ReportService.dll llPDFFont                     
TPDFTrueTypeUnicodeFont.Create
01aa14de ReportService.dll llPDFFont                     
TPDFFonts.GetUnicodeFont
01aa11f4 ReportService.dll llPDFFont                     TPDFFonts.GetFontByInfo
01ac44e9 ReportService.dll llPDFCanvas                   TPDFCanvas.ReceiveFont
01ac521d ReportService.dll llPDFCanvas                   
TPDFCanvas.SetCurrentFont
01ac76cc ReportService.dll llPDFCanvas                   
TPDFCanvas.UnicodeTextShow
01ac44ad ReportService.dll llPDFCanvas                   
TPDFCanvas.RawUnicodeTextOut
01ac6c87 ReportService.dll llPDFCanvas                   
TPDFCanvas.UnicodeTextOut
01ac7d23 ReportService.dll llPDFCanvas                   TPDFCanvas.TextOut

Original issue reported on code.google.com by roland.r...@gmail.com on 2 Aug 2012 at 7:12

Attachments:

GoogleCodeExporter commented 9 years ago
probably fixed in revision 99 (ScaleMM2, 
http://scalemm.googlecode.com/svn/branches/version2/smmLargeMemory.pas) for an 
other memleak report. Can you re-test it with this version? thanks in advance!

Original comment by andre.mussche on 20 Aug 2012 at 2:13

GoogleCodeExporter commented 9 years ago
Thank you for the quick reply. It seems that the problem is with TJpegImage 
component. In some cases it raise EOutOfResources exception.

Original comment by roland.r...@gmail.com on 21 Aug 2012 at 8:43

GoogleCodeExporter commented 9 years ago
Have you tried the new version? Does it still exist? If so, can you try to make 
a simple test application to reproduce?

Original comment by andre.mussche on 21 Aug 2012 at 8:59

GoogleCodeExporter commented 9 years ago
I've tested with the revision #99. Currently there's no leak, not even under 
high load. But as I mentioned the problem was not with scalemm but with 
TJpegImage. You can find a plenty of error report about it on the net.

Original comment by roland.r...@gmail.com on 21 Aug 2012 at 9:06