Note that there are some explanatory texts on larger screens.

plurals
  1. POMemory issue in ARC
    primarykey
    data
    text
    <p>I am using UINavigationcontroller as root view controller. I am new to iphone ARC and sqlite operations under ARC. </p> <ol> <li>My rootviewcontroller is loginviewcontroller next is homeview which contains scrollView with 4 UIviewcontroller in it.</li> <li><p>I am using Instruments to test as I am getting a memory warning. After using my app for about 5-10 minutes, when I logout (for this I am using popToRootViewController) and login again Live Bytes goes on increasing and when I check Call Trees -</p> <pre><code> [NSObject(NSTreadPerformAdditions) performselectorOnMainThread:withObject:waituntilDone:] </code></pre></li> </ol> <p>shows <strong>15.91MB Bytes</strong> used and following it shows </p> <p>I am also doing SQLite operations and upon performing those operations, it adds around </p> <p>if(sqlite3_open([[self filePath]UTF8String],&amp;dBObject)!= SQLITE_OK)</p> <p>shows <strong>10MB Live Bytes</strong> for opendatabase, selectquery and update</p> <p>For the first time I tested my app using Instruments, it showed the following: <img src="https://i.stack.imgur.com/28wr9.png" alt="enter image description here"></p> <p>How can i release this memory now?</p> <p><strong>EDIT:</strong></p> <p>i am using this code for retriving data </p> <pre><code>-(int)CheckCompanyIsAvailableInTradeList:(NSString *)CompanyId UserId:(NSString *)userId { int check=0; if(sqlite3_open([[self filePath] UTF8String], &amp;dBObject) == SQLITE_OK) { NSString *sqlStatement =NULL; sqlStatement = [ NSString stringWithFormat:@"SELECT COUNT(*) FROM tradelist WHERE compnyID = '%@' and UserMasterID ='%@' ;",CompanyId,userId]; if(sqlite3_prepare_v2(dBObject, [sqlStatement UTF8String], -1, &amp;statement, NULL) == SQLITE_OK) { @autoreleasepool { while(sqlite3_step(statement) == SQLITE_ROW) { check = sqlite3_column_int(statement, 0); } } } sqlite3_finalize(statement); } sqlite3_close(dBObject); return check; } </code></pre> <blockquote> <p>whenever this method is called live bytes goes on increasing continously</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload