memory-management

How to fix a memory error in PHP?

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1078799 bytes) in D:\xampplite\htdocs\Scraper\PHPExcel\Reader\Excel2007.php on line 269 This error happens even when I just open a excel file of ~350 KB using PHPExcel. I am puzzled why 128 MB get exhausted when I just try to open a small excel ...

What about this mailto: openURL might be causing a this malloc crash?

I'm using openURL to send an email w/some links. The function looks like this: // + (void) sendEmail:(NSString *) subject withBody:(NSString *)body { NSString *mailString = [NSString stringWithFormat:@"mailto:?@&subject=%@&body=%@", [subject stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], [body stringBy...

Why would this mailString autorelease be redundant?

From a related thread, how should I have known the "mailString" below was already autoreleased? // + (void) sendEmail:(NSString *) subject withBody:(NSString *)body { NSString *mailString = [NSString stringWithFormat:@"mailto:?@&subject=%@&body=%@", [subject stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], ...

Once I enable Zombies, how do I hunt them down?

Continuing some helpful StackOverflow debugging, I have a zombie I need to track down: 2010-08-22 10:18:51.111 AppName[106:307] *** -[CFString release]: message sent to deallocated instance 0x19f3b0 How would one find the variable name or whathaveyou for the 0x19f3b0 Zombie? ...

How do you check a memory allocation by address in the XCode debugger?

I am trying to debug some stuff and while I'll also RTFM can anyone tell me how to check the allocation of a memory address in XCode? The text I automatically jump to on the error is not immediately decipherable. In an ideal world I'd like to figure out the name of the variable (or at least its contents) that I just re-released. An exam...

Somehow my singleton properties are getting released.

I have a singleton object called PoolManager that loads and saves some data in a plist. Throughout my program when something needs to know about my pool, it asks the [PoolManager sharedPoolManager] for it's properties. I have a single view that's responsible for setting these properties and all others just read from it. It was all wor...

Memory of the Contacts on iPhone?

Hi, everyone, I want to ask a question about the Contacts on objective C. I am writing a program which will add the people to the iPhone build-in Contacts by ABPerson. However, I don't know I can add how many users to the iPhone. Are there some limitations of adding the contacts to the address book? I mean the number of user, adding fie...

Trying to track down a memory leak in a cocos2D application.

I am trying to track down a memory leak in my cocos2D game. I have run the game using instruments to find what is causing the leaks and the bulk of the problem seems to come from this method. -(void)setColour:(int)c { switch (c) { case RED: images[SMALL_BUBBLE_IMAGE] = [[CCTexture2D alloc] initWithImage:[UIImage imageNamed...

WebView Memory Management

An application that I am developing retains several WebViews that are used to allow an embedded web browsing experience for some activities centralized around the application. The problem that I am having is that after several hours open and after a lot of use the views begin to build up memory. My understanding of the memory management ...

Does "self.propery = [[SomeClass alloc] init];" leak memory?

Is it safe in Objective-C to write self.propery = [[SomeClass alloc] init]; instead of SomeClass *tmp = [[SomeClass alloc] init]; self.property = tmp; [tmp release]; or will the first form leak memory? ...

Flash Total Memory Usage and TaskManager Memory Usage are diffrent?

Hi I wrote an application in flash AS3, and when I trace from flash the total memory usage of the total application is only about 9MB, But at the same time Task Manager Shows the memory usage as 110MB. Around 100MB difference. Flash Trace Method System.totalMemory difference of the Trace from the Beginning of the application to end of ...

Simulate Memory Warning on iPad

Hi All, I am developing an iPad application which is having a custom Tabbar and a custom Header Bar. The header bar and Tabbar will stay there in the app in all views. The first view is the login view and with the simulator running when I made a "Simulate Memory Warning" the Whole screen goes Blank (White Color). Only the headerbar and...

How is memory allocated for an ASP.NET website?

Hi All, My website is using a lot of memory and I have downloaded the trial of ANTS Memory Profiler. The site is using XML files to store the the categories and the items that belong in those categories - I then traverse the files (4mb for the categories file and about 800kb for the items file stored on the local machine (web server)) a...

windbg "Free" object type

Monitoring my program's Virtual Bytes usage while it is running showed that by doing some kind operations, the virtual bytes usage goes up by about 1GB in about 5 minutes. The program deals with tcp sockets and high data transfer throughput between them (~800Mbps). Loading a dump file of the program in windbg showed that the reason for ...

How to release the memory of structures pointed by an pointer-array?

I have a pointer array defined as some_struct * t_ptr[1000] which points to a structure some_struct.And some points of the point array are evaluated.e.g some_struct * wpaper1 = new some_struct(); //memory leaks detected in this line wpaper1->tAnswer = useransw; wpaper1->tKey = key; t_ptr[100] = wpaper1; //there're wpaper2,wpaper3....

Saving RAM on Shared Hosting with persistent process web service (e.g. Ruby on Rails, Turbogears, etc.)

I use Turbogears on my shared hosting for one-off applications, but I don't need these applications active all the time. Is there a way to start the service when I request it, and then kill the process when it's idle? For example, Turbogears will have a persistent process: "paster serve production.ini" that I would like killed if there...

the output of my fortran code is killed , any suggestion?

I'm trying to run a code on ssh that works perfect for a smaller mesh , but since the new mesh is much bigger i used ifort command to compile it, ifort -mcmodel=medium -i-dynamic -otest.out*.f and it complies but when i run it , the output is: killed i know that problem is from memory, does anyone know if there's any way to run it? how...

Background mode server communication drains battery

I developed an app that makes a photo and submits it with some text to my web service. Now when my app is running (even in a background mode) the battery drains in 4 hours and my iPhone is getting really hot. I thought it may be a problem with the device but after visiting an Apple Store they said the battery is fine and that the proble...

Webkit Memory Swapping in Objective-C

I have an instant messaging (gtalk, aim, etc.) client that uses webkit to render the view of messages similar to Adium. Several users who appear to be very active IM users say that the app starts using 200+ MB of ram after several hours of use. Is there anyway to swap the memory to disk for windows that are not active as to save the over...

problem with cellForRowAtIndexPath method in UITableView iphone (indexPath.row is null)

Hi All, Table view cell management has driving me crazy from past two days. Please check the code below and I will explain you the problem in detail.. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tabl...