releasing arrays objective-c
In Objective-c I have this: SomeObject *values[3][3]; when deallocating, as in C++ should I release element by element? Or if I do: [values release]; is ok? ...
In Objective-c I have this: SomeObject *values[3][3]; when deallocating, as in C++ should I release element by element? Or if I do: [values release]; is ok? ...
My iPhone app generally uses under 5MB of living memory and even in the most extreme conditions stays under 8MB. The iPhone 2G has 128MB of RAM and from what I've read an app should only expect to have 20-30MB to use. Given that I never expect to get anywhere near the memory limit, do I need to care about memory warnings and setting ob...
I'm new to the iPhone and objective-c and I am still trying to get my head around ownership of objects so bear with me. I have a DOBViewController that has a datepicker on it. I have created a custom init method: -(id)initWithInitialDate(NSDate *)initialDate; Another view controller has a date instance declared (NSDate *dob) that hol...
Is there a way to find out how much memory is being used by a web page, or by my jquery application? Here's my situation: I'm building a data heavy webapp using a jquery frontend and a restful backend that serves data in JSON. The page is loaded once, and then everything happens via ajax. The UI provides users with a way to create m...
Why is an object initialization using the "new" keyword called dynamic memory allocation, since compile time itself we know the memory needed for that object. Also please explain what happens when you do ClassA object = new ClassA(); in heap and stack . ...
I have a simple function that returns an NSString after decoding it. I use it a lot throughout my application, and it appears to create a memory leak (according to "leaks" tool) every time I use it. Leaks tells me the problem is on the line where I alloc the NSString that I am going to return, even though I autorelease it. Here is the...
I ran dotTrace on my application (which is having some issues). IntPtr System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr) Void System.Windows.Forms.UnsafeNativeMethods.WaitMessage() Are the two main functions that came up, taking about 94% of the application time. Since I didn't know what ...
It is a compiler error or runtime error? The code below can be compiled! class Base{ void g(); void h(); }; int main() { Base* p = new Base(); free(p); return 0; } However it can't be compiled with a virtual function if I declare the class Base like this class Base{ virtual void g(); void h(); }; The code below can be co...
Hi, I have a question relating to alignment in c/c++. In http://stackoverflow.com/questions/364483/determining-the-alignment-of-c-c-structures-in-relation-to-its-members Michael Burr posted this Makro: #define TYPE_ALIGNMENT( t ) offsetof( struct { char x; t test; }, test ) in the comments someone wrote this might fail with non POD ...
In Qt I'm trying to set up my own QWidget so everything should work good due to memory management and other things. But I can't seem to get it all right with pointers, heap and stack. I have my widget MyWidget that have a QList with some objects. I can't figure out how to set up everything right. You can see my code below and I have som...
Newbie question: I have a forms application. It has a separate thread which makes a web services call, and then posts the results of the call to the main form. In my thread, after X seconds have passed (using a TTimer), I call: procedure TPollingThread.OnTimer(Sender: TObject); var SystemProbeValues : TCWProbeValues; begin SystemPr...
if this is a bad idea, how to allocate memory in the function? ...
I'm playing around with writing some simple Spring-based web apps and deploying them to Tomcat. Almost immediately, I run into the need to customize the Tomcat's JVM settings with -XX:MaxPermSize (and -Xmx and -Xms); without this, the server easily runs out of PermGen space. Why is this such an issue for Java VMs compared to other garb...
Hi, I'm consistently seeing the same message sent in as a crash report from users of an app. It's clear that an object is being over-released but I'm unable to replicate it and I'm looking for tips on tracing the source of it. The relevant section from the crash report shows this: Application Specific Information: objc_msgSend() selec...
Regarding Delphi memory management, what are your design strategies ? What are the use cases where you prefer to create and release Objects manually ? What are the uses cases where Interfaces, InterfacedObjects, and their reference counting mechanism will be preferred ? Do you have identified some traps or difficulties with reference...
Hi there! Maybe a FAQ at this website. I have a TableViewController that holds a form. In that form I have two fields (each in it's own cell): one to select who paid (single selection), and another to select people expense is paid for (multiple selection). Both fields open a new TableViewController included in an UINavigationControlle...
I do this: NSString *fullpath = [[NSBundle mainBundle] pathForResource:@"text_file" ofType:@"txt"]; Why the following message appear? Is my code leaking? 2010-03-31 13:44:18.649 MJIPhone[2175:207] *** _NSAutoreleaseNoPool(): Object 0x3909ba0 of class NSPathStore2 autoreleased with no pool in place - just leaking Stack: (0x1656bf 0xc8...
I am developing a small web-utility that displays some data from some database tables. I have the utility running fine on FF, Safari, Chrome..., but the memory management on IE8 is horrendous. The largest JSON request will return information to create around 5,000 or so rows in a table within the browser (3 columns in the table). I'...
I'm disassembling an executable: (gdb) disas main Dump of assembler code for function main: 0x004012d0 <main+0>: push %ebp 0x004012d1 <main+1>: mov %esp,%ebp ... Each time the memory address is the same:0x004012d0. Isn't the memory address to be dynamically assigned by the OS? UPDATE Now I see it's virtual space,and it c...
Quick question regarding memory management in C++ If I do the following operation: pointer = new char [strlen(someinput_input)+1]; And then perform it again, with perhaps a different result being returned from strlen(someinput_input). Does this result in memory being left allocated from the previous "new" statement? IE, is each new ...