1

i had stuck at the point.i need to retrieve memory occupied by iphone inbuilt application like music,photo,movies,application etc...any one have idea please let me know.

like display detail like same. How to get Storage Size of Applications programmatically in iPhone

so please help me

Community
  • 1
  • 1
Mehul darji
  • 186
  • 1
  • 9
  • I doubt there is a legitimate way to get this information. Applications are not allowed to look at info about other apps. – borrrden May 18 '12 at 05:04

1 Answers1

1
#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 in use (in bytes): %u", info.resident_size);
    } 
    else
    {
        NSLog(@"Error with task_info(): %s", mach_error_string(kerr));
    }
}

you can see the size of memory in bytes

Atulkumar V. Jain
  • 5,102
  • 9
  • 44
  • 61
Prabhjot Singh Gogana
  • 1,408
  • 1
  • 14
  • 39
  • you can see the size of memory in bytes – Prabhjot Singh Gogana May 18 '12 at 05:09
  • However, there is no legitimate way to split this among various apps. – CodaFi May 18 '12 at 05:11
  • 1
    @Pavi jay No special headers included, seriously ? What's your idea of how it works then ? – A-Live May 18 '12 at 05:21
  • can i have detail like same.http://stackoverflow.com/questions/9603776/how-to-get-storage-size-of-applications-programatically-in-iphone – Mehul darji May 18 '12 at 05:26
  • There is also a field in the structure info.virtual_size which will give you the number of bytes available virtual memory (or memory allocated to your application as potential virtual memory in any event). The code that pgb links to will give you the amount of memory available to the device and what type of memory it is – Prabhjot Singh Gogana May 18 '12 at 05:27
  • or see that link http://landonf.bikemonkey.org/code/iphone/Determining_Available_Memory.20081203.html it may help you. if it help please click on up button – Prabhjot Singh Gogana May 18 '12 at 05:38