memory-leaks

Memory leak in XML Parser

Hi everyone I use NSXMLParser for parsing an XML document. I have the following functions (among others): - (void) parserDidStartDocument:(NSXMLParser *)parser { // Init tempString tempString = [NSMutableString string]; } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)n...

MPMoviePlayerController release problem

here is code - (void)applicationDidFinishLaunching:(UIApplication *)application { NSBundle *bundle = [NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"sample_mpeg4" ofType:@"mp4"]; NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController al...

Why do interface implementations based on TComponent leak memory?

This Delphi code will show a memory leak for an instance of TMyImplementation: program LeakTest; uses Classes; type MyInterface = interface end; TMyImplementation = class(TComponent, MyInterface) end; TMyContainer = class(TObject) private FInt: MyInterface; public property Impl: MyInterface read FInt write FI...

Growing in the "Virtual bytes" performance counter

Hi, I am suffering from an "Out of memory" exception in my Windows Service after running it for few hours under huge workload. I used the following performance counters to detect memory leaks: # bytes in all heap Private bytes Virtual bytes The first 2 counters are going up and down regularly ... I cant see anything wrong in them. bu...

How to guard against memory leaks?

I was recently interviewing for a C++ position, and I was asked how I guard against creating memory leaks. I know I didn't give a satisfactory answer to that question, so I'm throwing it to you guys. What are the best ways to guard against memory leaks? Thanks! ...

Simple code analyzer

Need a simple code analyzer to see if I am forgetting to free objects and classes, or to see if I am releasing them to many times. ...

Fix external library ThreadLocal leak in WebLogic 10

In a web application running in WebLogic, we are using a (commercial) library which doesn't free the ThreadLocal variables it uses. Each time a method in the library API is used, some Kbs of information are leaked in the Thread that processes the request. We are in the way of getting rid of the library but, in the meantime, we would lik...

How can I correlate pageviews with memory spikes?

I'm having some memory problems with an application, but it's a bit difficult to figure out exactly where it is. I have two sets of data: Pageviews The page that was requested The time said page was requested Memory use The amount of memory being used The time this memory use was recorded I'd like to see exactly which pageviews...

Need help finding the leak in this code please.

#import <UIKit/UIKit.h> int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil);<-----This line gets highlighted as the leak [pool release]; return retVal; } It leaks right when I start the app. ...

iPhone mapView / mapKit using removeAnnotation & addAnnotation results in memory leak?

To update the location of a GPS indicator on mapView... [mapView removeAnnotation:myGpsAnnotation]; [myGpsAnnotation release]; myGpsAnnotation = nil; myGpsAnnotation = [[MapLocationAnnotation alloc] initWithCoordinate:region.center annotationType:MapAnnotationTypeGps title:MAP_ANNOTATION_TYPE_GPS]; [mapView addAnnotation:myGpsAnnotation...

Why does my windows console application leak when idling? (And why does the smoking gun point at kernel32.dll??)

Hello everyone. I have a windows multi-threded console application that appears to be leaking approximately 4kb private memory every minute or so. In an effort to localise the leak, I have gradually suspended each thread in the application until the leak stopped, and to my surprise the culprit seems to be a thread named "Win32Thread". ...

EventHandler and Memory Leaks

I analyze a VB.NET project and there are some objects(child MDI form) that are disposed, but not removed by the GC. The MemoryProfiler analysis find between others the following: "This instance is disposed and still indirectly rooted by an EventHandler. This often indicates that the EventHandler has not been properly remov...

UINavigationController: When Does a Pushed View Receive the Dealloc Message?

I would expect that after I push a view controller I then need to release my ownership of the view controller like I did below. CustomViewController *nextViewController = [[CustomViewController alloc] initWithNibName:@"CustomView" bundle:nil]; [[self navigationController] pushViewController:nextViewController animated:YES]; [nextViewCo...

OpenGL GPU Memory cleanup, required?

I have a simple but unanswered question. Do I have to clean up all DisplayLists, Textures, (Geometry-)Shaders and so on by hand via the glDelete* functions, or does the GPU mem get freed automagically when my Program exits/crashes? Note: GPU mem refers to dedicated memory on a dedicated Graphics card, not CPU memory. ...

Common Perl memory/reference leak patterns?

I'm chasing a couple of potential memory leaks in a Perl code base and I'd like to know about common pitfalls with regards to memory (mis-)management in Perl. What are common leak patterns you have observed in Perl code? ...

Why might _CrtSetBreakAlloc not cause a breakpoint?

I'm using Visual CRT's memory leak detection routines from <crtdbg.h>; when I call _CrtDumpMemoryLeaks one allocation is reported consistently on every invocation of the program: {133} normal block at 0x04F85628, 56 bytes long. Data: < > B0 81 F8 04 B0 81 F8 04 B0 81 F8 04 CD CD CD CD The address varies but {133} is a...

Can Delegates cause memory leaks?

Can Delegates cause memory leaks? I mean, by e.g. if a class A contains a ADelegate and the latter points to the BMethod (of B class) can this prevent the A class or B class collection by the GC? If so, how can we "free" delegates (setting ADeletate = Nothing / null?) How do you comment this one: //Class A Finalize, containing ADeleg...

Leaks not caused by application code - Will it get approved?

Hi All Another memory question on iPhone - When running the leaks application I see a number of leaks get identified, but are caused by NSFoundation or similar, rather than my application code. Where my application name is mentioned, I have obviously resolved the leak. I assume I can ignore these and that my app will be approved, or am...

Help finding a Memory Leak cause

I have the following Leak situation in a VB.NET (.NET2) application: a form - DetailTache (TaskDetails) - in my MDI application is not garbage collected is not collected ofter open/close. I did the following profiling root: any idea how this leak could be fixed? thanks. EDIT: Result search from projet of WinComboRowSelected Event....

System-specific bug hunting?

Hey all, I have recently been messing around with SFML, a multimedia library. I use C# so naturally I went for the .Net binding, which you can fetch from the SVN in the latest 2.0 version. After a while of messing around I noticed that my application would sometimes hang up when using the Text object, an object used to draw texture font...