is there a way to nslog how much memory your application is currently using?
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.
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).
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.
#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));
}
}
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