[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1568
  • Last Modified:

Finding Available Memory in Delphi XE2 for iOS Application

I haven’t had to do this for quite some time, but I think I need to trace a memory leak. I’m using Delphi XE2’s FireMonkey to create an iOS application. Years ago, I would use the TMemoryStatus object to give me feedback as to free memory like so:

var
  MS: TMemoryStatus;
  AString:String;
 
begin
GlobalMemoryStatus(MS);
AString:= Format(‘%12.0n’, [MS.dwAvailPhys]);
end;

In XE2, the TMemoryStatus object appears to be no longer defined in the SysUtils unit that is used for iOS applications and so gives an unidentified error.

My question is how can I similarly query available memory to find out where my leak might be?
0
efz
Asked:
efz
2 Solutions
 
rinfoCommented:
0
 
Hamidreza VakilianSenior iOS DeveloperCommented:
These links are talking about functions which displays the instant RAM usage (but in Xcode):
http://stackoverflow.com/questions/7989864/watching-memory-usage-in-ios
http://stackoverflow.com/questions/5012886/knowing-available-ram-on-an-ios-device

Notice that even you find the equivalent function on Delphi; It won't help you much to catch those leaks since it's not going to provide any details or trace about the occurring leaks. Instead I suggest you to use Instruments (If it supports delphi projects)
Also check Valgrind a powerful debug tool which is able to find memory leaks.
0
 
efzAuthor Commented:
My programming problem ended up not being related to a memory leak, so I didn't test the code suggested by rinfo's link.

Certainly Programmer-x's recommendation is the ticket once things are move to Xcode.

Please accept my sincere thanks for your time and expertise.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now