memory-leaks

tabBarController memory leak

In my AppDelegate I initiate a tabBar Controller, to which a bunch of navigationController is added as tabs. I use the following code: // Init tabBar Controller tabBarController = [[[UITabBarController alloc] init] retain]; // Init Root Views of navigation controllers FirstRootViewController* firstViewController = [[[FirstRootViewContr...

How does NSViewController avoid bindings memory leak? [have sample app]

I'm trying to implement my own version of NSViewController (for backwards compatibility), and I've hit a problem with bindings: Since bindings retain their target, I have a retain circle whenever I bind through File's owner. So I thought I'd just explicitly remove my view from its superview and release the top level objects, and that wo...

getmem memory leak, delphi

Hi all I am trying to run a old midi component in Delphi, and it works for the most part of it, but if I try loading 2 files in a row, it crashes. some research led me to install EurekaLog, which point to memory leaks in the code.yay! I'm not very good with memory pointers stuff, but this code down is highlighted by Eureka here got me...

When to release an object added to an NSMutableDictionary

Hello. I am working on an iPhone app that will construct, at run-time, an NSMutableDictionary for which the values (of the key-value pairs) will be NSMutableArrays. Being somewhat new to the Objective-C, I am concerned that the following will cause a memory leak: - (void) addNewSupplierPhoto:(UIImage*)image toSupplierID:(NSInteger*) sup...

iPhone memory leak help

This code is leaking, the performance tool blames two leaks on this block of code. If i comment it out the leak doesn't happen. Any help pinning it down would be greatly appreciated. Leaks: Malloc 48 bytes NSCFarray 32 bytes Code Block: NSArray *myArray = [[NSArray alloc] initWithObjects: @"Add", @"Edit", nil]; segmentContro...

jQuery-UI Dialog Memory Leaks

I'm working with IE7 and some jQuery dialogs and I'm running into about a 6meg leak per dialog opened. I'm assuming it's to do with closures, but so far everything I've done to remove them haven't helped. At this point I think I've taken care of all the closures except on for a callback function I pass in, but it's still leaking 6 megs e...

[C] Freeing memory after use

I have a command line C program for which I use the calloc() function to assign some memory for a struct which also has a struct in it with some memory assigned. If I use the free() function to release the memory from the parent struct, will it also release the memory from the child struct? Or should I release the memory from the child...

Memory still increasing when use CFRelease for ABRecordCopyValue???

hi everyone, i have a problem make headache, i simply create method: -(void) main{ for (int i = 0; i< 100;i++) { [self getPhoneOfContact:i]; } } -(void)getPhoneOfContact:(NSInteger)id_contact { ABRecordRef record = ABAddressBookGetPersonWithRecordID(addressBook,id_contact); CFTypeRef ref1; ref1...

How to find the source of increasing memory usage of a twisted server?

I have an audio broadcasting server written in Python and based on Twisted. It works fine, but its memory usage is increasing when there are more users on server, but the memory usage never goes down when those users get off line. As you see in following figure: You can see the curve of memory usage goes up where the curve of listener...

Will it leak if delete using base-class pointer?

Given two classes have only primitive data type and no custom destructor/deallocator. Does C++ spec guarantee it will deallocate with correct size? struct A { int foo; }; struct B: public A { int bar[100000]; }; A *a = (A*)new B; delete a; I want to know do I need to write an empty virtual dtor? p.s. I have tried g++ and vc++2008 and...

Resource leaks when using a VCL (C++Builder) DLL from .NET

I have a DLL that's written in C++Builder (2006), and I'm invoking a single function in the DLL from a .NET application. The problem is, when I close the .NET application (and the DLL gets detached from it) I get a CodeGuard error saying that it detected resource leaks (and I see the leaks in the CodeGuard log file). I also see the Loa...

_CrtMem* and the debug heap

When I use the following code, it detects a memory leak. How can I make it not? _CrtMemState startState; _CrtMemState endState; _CrtMemState temp; _CrtMemCheckpoint(&startState); const char* foo = "I'm not leaking memory! Stop saying I am!"; _CrtMemCheckpoint(&endState); _CrtMemDifference(&temp, &startState, &endState); // Returns ...

CakePHP Web Crawler Memory Leak

I am developing an application that is, to put it simply, a niche based search engine. Within the application I have include a function crawl() which crawls a website and then uses the collectData() function to store the correct data from the site in the "products" table as described in the function. The visited pages are stored in a dat...

What is the difference between Java Memory Analysis Tools and Memory Leak Detection Tools?

Is there any difference between Java Memory Analysis Tools (profilers like Yourkit Java Profiler) and Java Memory Leak Detection Tools? (From my searches, the difference is pretty hard to notice in what tools are concerned, but it sounds to me like a difference in the approach manner). If there is, are there any free (available for down...

MKMapView Memory Leak in iPhone Application

I am working on an iPhone application which uses MKMapView and shows userlocation. I am getting memory leaks where leaked object is NSCFArray of size 128 Bytes, GeneralBlock-16, GenralBlock-8 when is set MKMapView's showUserLocation property as TRUE. If is set it as NO then i dont get this leak. Can anyone suggest that what can be the po...

C++ will this function leak?

Hello, I have started out to write a simple console Yahtzee game for practice. I just have a question regarding whether or not this function will leak memory. The roll function is called every time the dices need to be re-rolled. What it does is to create a dynamic array. First time it is used it will store 5 random values. For the next...

Reassignment of a reference

Suppose I have a class class Foo { public: ~Foo() { delete &_bar; } void SetBar(const Bar& bar) { _bar = bar; } const Bar& GetBar() { return _bar; } private: Bar& _bar; } And my usage of this class is as follows (assume Bar has a working copy constructor) Foo f; f.SetBar(*(new Bar)); const Bar* bar =...

Releasing NSArray containing NSDictionary objects

I am having difficulty getting my head around memory management in the following segment of code on iPhone SDK 3.1. // Create array to hold each PersonClass object created below NSMutableArray *arrayToReturn = [[[NSMutableArray alloc] init] autorelease]; NSArray *arrayOfDictionaries = [self generateDictionaryOfPeople]; [arrayOfDiction...

Is following scenario called memory-leak in java? Is it not Garbage Collected?

If any object variable is still pointing to some object which is of no use, then JVM will not garbage collect that object and object will remain in memory creating memory leak In the above scenario there is possibility of memory leak.. Why is it not Garbage Collected? Can anybody elaborate on it? ...

Memory leak while sending email

Hello everybody! I have a windows service, which is configured to send emails in a predefined schedule. The schedule works with System.Timers.Timer and every time the Timer_Elapsed is raised I call Timer.Stop(), send emails (each time about 1500 emails), calculate the amount of time the next tick will be raised and start the timer (call...