Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone memory usuage

Tags:

iphone

is there a way to nslog how much memory your application is currently using?

like image 511
Joo Park Avatar asked May 07 '10 06:05

Joo Park


People also ask

What takes the most memory on an iPhone?

Here's how to check and manage storage on your iPhone: Go to Settings > General > iPhone Storage. At the top, you'll see a color-coded bar showing how much space you have left, how much is taken up, and what's taking it up. The biggest categories are usually Photos and Apps, but that depends on your usage.

Is 128GB enough for iPhone?

All iPhone 14 models ship with 128GB as base storage, and that's enough for a lot of people. With that much storage, you can hold around 3,368 apps at an average size of 33MB. It's a huge number, and most people don't need to have more than a few hundred on their phone at any given time (and that is pushing it).

Why am I using so much storage on my iPhone?

It's comprised of system caches, logs, Siri voices (if you've downloaded other voices), updates, and so much more. One of the biggest culprits for Other growing out of hand is streaming lots of music and video. When you download video or music from the iTunes store, TV app, or Music app, it's indexed as Media.


1 Answers

#import <mach/mach.h>


void report_memory(void) {
  struct task_basic_info info;
  mach_msg_type_number_t size = sizeof(info);
  kern_return_t kerr = task_info(mach_task_self(),
                                 TASK_BASIC_INFO,
                                 (task_info_t)&info,
                                 &size);
  if( kerr == KERN_SUCCESS ) {
    NSLog(@"Memory used: %u", info.resident_size); //in bytes
  } else {
    NSLog(@"Error: %s", mach_error_string(kerr));
  }
}
like image 182
David Wong Avatar answered Sep 20 '22 01:09

David Wong