I am maintaining a legacy application and I have the following line of code:
sb.Panels[3].Text:= ' Memory in use: ' + IntToStr(AllocMemSize);
And it gives the following warning:
[dcc32 Warning] BLOB.pas(8242): W1000 Symbol 'AllocMemSize' is deprecated
and indeed, AllocMemSize is deprecated (from System.pas):
var
AllocMemSize: Integer deprecated; {Unsupported}
My question is this: What is the replacement for AllocMemSize
? Is there any point? Is there some other more meaningful measure I can put there?
(I guess I can just delete the call and output entirely, but users apparently want to see this information in the Status Bar)
Call GetMemoryManagerState
instead. It returns similar information, although not necessarily distilled down to a single number like AllocMemSize
. The deprecation is due to Delphi's switch around Delphi 2006 to using FastMM for the memory manager, and it tracks memory differently from the older memory manager.
See also Monitoring memory usage in the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With