I am working on some sort of image batch resampler app with comparisons and thought I'd give your Stretch routine a try. The app is building up on memory usage quickly after a few hundred resizes, so I took in fastmm leak detection to track it. Among other things, I noticed that something from madGraphics.GetContributorList is leaking. The stacktrace is not very helpful here though:
Code: Select all
totaling 70656 bytes, 256 pieces of
This block was allocated by thread 0xAC4, and the stack trace (return addresses) at the time was:
40485D
40A138
40A20E
A1602B [madGraphics][madGraphics][madGraphics.GetContributorList]
411CB3 [FastMM4.pas][FastMM4][FastMM4.DebugGetMem][8757]
411FE7 [FastMM4.pas][FastMM4][FastMM4.DebugAllocMem][9022]
A17722 [madGraphics][madGraphics][madGraphics.Resampling24]
4D1082 [Graphics.pas][Graphics][Graphics.TBitmap.CopyImage][7857]
75416B30 [Unknown function at GdiInitializeLanguagePack]
75416C31 [Unknown function at GetCurrentObject]
75416C9A [GetObjectW]
180 bytes, 1 piece of
This block was allocated by thread 0xAC4, and the stack trace (return addresses) at the time was:
411EDA [FastMM4.pas][FastMM4][FastMM4.DebugReallocMem][8935]
A15D8D [madGraphics][madGraphics][madGraphics.AddItem]
40482B
40A138
40A20E
A1621E [madGraphics][madGraphics][madGraphics.GetContributorList]
411CB3 [FastMM4.pas][FastMM4][FastMM4.DebugGetMem][8757]
411FE7 [FastMM4.pas][FastMM4][FastMM4.DebugAllocMem][9022]
A17722 [madGraphics][madGraphics][madGraphics.Resampling24]
4D1082 [Graphics.pas][Graphics][Graphics.TBitmap.CopyImage][7857]
75416B30 [Unknown function at GdiInitializeLanguagePack]
2244 bytes, 1 piece of
This block was allocated by thread 0xAC4, and the stack trace (return addresses) at the time was:
40485D
40A138
40A20E
A15FA0 [madGraphics][madGraphics][madGraphics.GetContributorList]
411CB3 [FastMM4.pas][FastMM4][FastMM4.DebugGetMem][8757]
411CE0 [FastMM4.pas][FastMM4][FastMM4.DebugGetMem][8777]
411FE7 [FastMM4.pas][FastMM4][FastMM4.DebugAllocMem][9022]
A17722 [madGraphics][madGraphics][madGraphics.Resampling24]
4D1082 [Graphics.pas][Graphics][Graphics.TBitmap.CopyImage][7857]
75416B30 [Unknown function at GdiInitializeLanguagePack]
75416C31 [Unknown function at GetCurrentObject]
One thing to note, these are not actual leaks, or at least they are not reported when the application closes, I caught them by setting group allocations for each iteration/operation and logging those to file. In a loop, they do build up.
I didn't spend much time debugging this as I've got bigger leaks to track down but if you want me to check/test something specific, let me know.
thanks