-1

In MacOs, you can see free, wired, active, inactive memory status by Activity Monitor. And, you can use commandline like "purge" to purge the memory.

Then, Can I do this in iOS? I am not familiar with Mach/BSD. And, Can someone else help me?

In Mac Osx, I can convert the inactive to free using following method.

char command_line[256];
sprintf(command_line, "purge");
FILE *fp = popen(command_line, "r");
if (fp) {
    pclose(fp);
}
Magic fish
  • 78
  • 11
  • 1
    You haven't defined the term purge, and you haven't explained why this is something you need in a program. – bmargulies Dec 25 '12 at 13:47
  • I see this app( https://itunes.apple.com/us/app/memory-100/id554435411?mt=8 ) can do this. So, I am very interesting how they do that. – Magic fish Dec 25 '12 at 14:08
  • 1
    Read the reviews. It is apparently a dud. – bmargulies Dec 25 '12 at 14:09
  • It's work. I write an app to read the free, wired, active, inactive memory. I found my app and that one both are same value (free, wired, active, inactive memory). So, it optimize function can convert the inactive memory to free memory! – Magic fish Dec 25 '12 at 14:27

1 Answers1

1

When your app allocates memory iOS automatically free requested amounts of memory by alerting other apps with special messages (memory warnings) and by unloading other apps. If your app requesting too much memory - it will be unloaded by iOS with special crash type.

There is no way to purge memory with user request on iOS platphorm. In order of public api terms.

Valerii Pavlov
  • 1,986
  • 1
  • 19
  • 30
  • I see this app( https://itunes.apple.com/us/app/memory-100/id554435411?mt=8 ) can do this. – Magic fish Dec 25 '12 at 14:07
  • The app you mention obviously does nothing at all - you should read the reviews @Magicfish – Till Dec 25 '12 at 14:23
  • It's work. I write an app to read the free, wired, active, inactive memory. I found my app and that one both are same value (free, wired, active, inactive memory). So, it optimize function can convert the inactive memory to free memory! – Magic fish Dec 25 '12 at 14:28
  • I think its fake. And must to be removed from store :\ – Valerii Pavlov Dec 27 '12 at 10:34