memory-leaks

Using delphi application's memory manager in a delphi DLL (without recompiling the application)

I need to write a DLL (using Delphi) which is dynamically loaded into delphi applications and makes RTTI queries (typical operation is to obtain string values for control properties). The classic problem is that passing strings (and objects) between application and DLL is problematic due to different memory managers used in both (this mi...

stringWithContentsOfURL leaking memory

Would it shed more light if I told that fetchHTML was being called in a seperate thread? I am also seeing several messages in the debug console such as: _NSAutoreleaseNoPool(): Object 0xd92860 of class NSCFDictionary autoreleased with no pool in place - just leaking _NSAutoreleaseNoPool(): Object 0xd92800 of class NSCFString autoreleas...

Memory leaks in C++ (via new+delete)

In order for an application to have no memory leaks, does the number of new in a C++ project match the number of delete? ...

Possible memory leaks on a plain jsp site

First of all, I lie, it's not really a plain jsp website. It has a couple of pages with database access and a lucene based search engine... and around 400 standalone jsp pages. The problem is that the admins on a production server we've not access to, say that the site is consuming too much memory (200+ Megs), and we are probably facing...

Perl memory usage profiling and leak detection?

I wrote a persistent network service in Perl that runs on Linux. Unfortunately, as it runs, its Resident Stack Size (RSS) just grows, and grows, and grows, slowly but surely. This is despite diligent efforts on my part to expunge all unneeded hash keys and delete all references to objects that would otherwise cause reference counts...

free() errors (debugging with valgrind)?

I have these structs: typedef struct _Frag{ struct _Frag *next; char *seq; int x1; int length; }Frag; typedef struct _Fragment{ int type; Frag *frag_list; }Fragment; And then I created a array Fragment *fragments=malloc(1,sizeof(Fragment)); // or more fragments->frag_list=malloc(1,sizeof(Frag)); // or more Frag *...

How to trace all ActiveX/COM objects life cyle in an ASP application?

Hi all, I'm fighting to find a memory leak in an old ASP application. I'm not the designer of this application (please kill me if one day I produce such an horror) moreover I'm far from being an ASP/JavaScript guru. I'm supposing that some ActiveX/COM objects are not freed correctly but it's huge job to trace all allocations. Some of t...

PHP memory leak and fork

Hi, I'm trying to avoid the memory leak in PHP. When I create a object and unset it at the end it's still in memory. The unset looks like: $obj = NULL; unset($obj); Still this will not help. My question is what will happen when I fork the proccess and the object will be created and destructed in the child thread? Will this be the sa...

Removing MKMapView Annotations causes leaks.

I've boiled a very complex set of web services and searches down to the simple following code. I need to be able to add annotations to a map in response to a search (or in the sample below to the click of a button), then allow the user to click the button again and get a new set of results. In reality there will be a different number, ...

Inherent UIView leak

When ran in activity monitor, the real memory usage for a program running the following piece of code will increase endlessly: CGRect frame = CGRectMake(0,0,0,0); while(true) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; UIView *test = [[UIView alloc] initWithFrame:frame]; [test release]; [pool release]; } What ...

UIImageWriteToSavedPhotosAlbum showing memory leak with iPhone connected to Instruments

Hi, I'm using version 3.0.1 of the SDK. With the iPhone connected to Instruments I'm getting a memory leak when I call UIImageWriteToSavedPhotosAlbum. Below is my code: NSString *gnTmpStr = [NSString stringWithFormat:@"%d", count]; UIImage *ganTmpImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:gnT...

cocoa 64bit binaries leak memory? (releasing NSData does not free memory)

i've been playing some time with different builds of my application and there seem strange things to happen: my app has a 5mb idle footprint. when uploading a file memory in size of the file is reserved. after the upload the reserved memory should be freed. now there are differences in the builds (gc = garbage collector): 32bit i386 n...

Instruments point a memory leak !

Hi, i'm have this code for initialize my class. - (id)initWithSize:(int)size { self = [super init]; if( self != nil ) { [self setMyVector:[[NSMutableArray alloc] initWithCapacity:size]]; for ( int i = 0; i < size; i++ ) { [myVector addObject: [[NSMutableArray alloc] initWithCapacity:size]]; } ...

Potential Memory Leak in my wxPython App

I am pretty sure I am suffering from memory leakage, but I havent 100% nailed down how its happening. The application Iv'e written downloads 2 images from a url and queues each set of images, called a transaction, into a queue to be popped off by the user interface and displayed. The images are pretty big, averaging about 2.5MB. So as...

Why NSTextView with no code produces memory leaks in Snow Leopard?

Hi! I can't figure out why a NSTextView created with IB in an empty Cocoa application project produces memory leaks when I type in it. I created a new project, then I drew a NSTextView in IB; I compiled and ran my project with Instruments-Leaks and when I typed something a lot of leaks appears in Instruments. Snow leopard, XCode 3.2 An...

iphone core data executeFetchRequest memory issue

Hi there, I keep getting a -> Program received signal: “EXC_BAD_ACCESS”. In the following code but I don't really understand why. If I comment out the "executeFetchRequest" lines it goes away. Shouldn't the [results release]; be all that's required? Thanks in advance, Matt // Implement viewDidLoad to do additional setup after loa...

Memory leak UIWebView when loading from file instead of URL?

I have a UIViewController that contains a UIWebView (OS 3.0). If I load it with file data, as soon as the 'Back Button' is hit and the view is dismissed, I'm seeing EXEC_BAD_ACCESS error with WebCore object releasing 'SharedBuffer' - (void)viewDidLoad { NSString *htmlFile = [[NSBundle mainBundle] pathForResource:fileName ofType:@"ht...

Why is this line leaking memory?

Any ideas why the line below would be leaking memory? cell.imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:person.imageURL]]; within the cellForRowAtIndexPath method: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView d...

Why should you have to dispose() a java.awt.Window that goes out of scope?

One of the memory leaks I've discovered in our application is the java.awt.Window.allWindows private static field, which keeps track of every Window instantiated. We have dialog boxes that are created, used, and then forgotten, and the expectation was that these would go away and be garbage collected. This private field keeps them in s...

Memory leaks always need a long-lived object?

Is this statement true, false, or poorly formulated: "In Java, memory leaks must always be related somehow to a long-lived object." In this context, I am referring simply to regular objects, and not to system resources in general (file descriptors, and so on). An example of a long-lived object might be a singleton (as typically imple...