memory-leaks

Where does this code leak?

Instruments is telling me that this code leaks. Where? Do I have to release conn? - (void)loadFeatureXML:(id<BPLFeatureLoaderDelegate>)delegate { _delegate = delegate; NSURLConnection *conn; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.myxmlfeed"]]; if ([NSURLConnection can...

free() not freeing up memory properly?

I'm trying to free up the memory I've allocated with malloc, but the free command doesn't seem to do its job properly according to Eclipse's debugger. How's this possible? Below is a screenshot of my debugger after it supposedly freed up seCurrent->student->year, which is clearly not the case. year was allocated using malloc. ...

Finding memory leaks in C code on Windows

I already know that I can trace memory leaks in my code with mtrace and valgrind on Linux, both of which are unavailable for Windows. Which Windows program would you recommend to trace memory leaks? I'm an Eclipse user and I've been working with C for a month or two now, so I prefer a user-friendly solution over something more advanced....

Massive memory leak when binding ItemsControl to an Observable Colleciton

I have an ItemsControl in a ScrollViewer. The ItemsControl.ItemSource is set to the Observable Collection. Every time I add an item to the collection, my application nearly doubles in memory usage and eventually after enough adds. Here is a rough sketch: <Scrollviewer Name="MyScroll"> <ItemsControl Name="MyItemsControl"> ...

Fixing a memory leak

I've ran Build and Analyze on my XML parsing code and found out the following: How could I fix it? ...

Actionscript 3: Memory Leak in Server Polling Presentation App

I'm building a remote presentation tool in AS3. In a nutshell, one user (the presenter) has access to a "table of contents" HTML page with links for each slide in the presentation, and an arbitrary number of viewers can watch the presentation on another page, which in turn is in the form of a SWF that polls the server every second to en...

How does XCode memory leak detection work?

How does the XCode Instrument Leak tool figure out if an object is a leak or just something not released yet? I'm pretty new to Objective C, the leak tool detects a leak in the code I work with. But the code looks sound to me. So just wondering how much can I trust this tool? ...

How to debug a strange memory leak ( C++ )

I'm writing a linux deamon and as for now it works pretty well, but it leaks memory ( and it's bad - after few hours it segfaults after using 60% of the system's memory). The strange thing is, that I'm using only new/delete operators and have a try/catch block around the main function, so it's not an exception thrown by new - it just seg...

Need help with memory leaks in RSS Reader

I'm trying to write a simple RSS reader for the iPhone, and it appeared to be working fine, until I started working with Instruments, and discovered my App is leaking massive amounts of memory. I'm using the NSXMLParser class to parse an RSS feed. My memory leaks appear to be originating from the overridden delegate methods: - (void)p...

dompdf memory issues

I'm using DOMPDF to generate about 500 reports from one script. It's running out of memory after about 10-15 PDFs have been generated. In debugging, it looks like it's loading 8M every time it gets to the font loading stuff, but this seems like something that should be handled with the font caching code. Any ideas of what's going wrong...

Memory leak during repeated lucene query searches?

Hi all, Basically, I simply want to do many searches on a given lucene index. Therefore, I made a class Data with final 'analyzer', 'reader', 'searcher' and 'parser' fields, (all properly initialized in the constructor). The class also provides a 'search' method to search the index. This is all shown in the code below. The problem is...

Cocoa memory management, why does my app keep using more?

I made a xfire client for mac (called BlackFire -> http://www.macxfire.com) and it keeps using more and more ram over time, even when not doing that much. I have run the app with instruments::leaks and it doesn't show any leaks at all (when it did i fixed them quickly). Somehow it still keeps using more ram, like it is supposed to or so...

Is it possible that memory leak can occurs at stack in .NET also?

Memory leak is, when there is unused memory in application and GC can collect it, normally it occurs if some where in application we keep unwanted strong reference of an object, and GC will able to find the path(Direct and indirect) so it can free this object, but this all are true about reference type that mean in Heap memory allocation...

.NET JIT Code Cache leaking?

We have a server component written in .Net 3.5. It runs as service on a Windows Server 2008 Standard Edition. It works great but after some time (days) we notice massive slowdowns and an increased working set. We expected some kind of memory leak and used WinDBG/SOS to analyze dumps of the process. Unfortunately the GC Heap doesn’t show...

Iphone -- Confused about leaks within my NSOperation

My app has an NSOperation class called ServerRequest that handles networking tasks. According to instruments, it is leaking like crazy. Additionally, instruments says the code that builds the request is leaking, even though that is not an NSOperation. But I have followed Apple's advice in terms of setting up an autorelease pool, so I ...

Python/Django polling of database has memory leak

I've got a Python script running Django for database and memcache, but it's notably runnning as a standalone daemon (i.e. not responding to webserver requests). The daemon checks a Django model Requisition for objects with a status=STATUS_NEW, then marks them STATUS_WORKING and puts them into a queue. A number of processes (created usin...

Memory leak with preg_replace

I'm using the preg_replace function to replace accents in a string, I'm working with UTF-8. I have incurred in what seems to be a memory leak, but I can't isolate the root cause, my code is rather simple: preg_replace( array_keys($aToNoAccents), array_values($aToNoAccents), $sText ); where $aToNoAccent...

iPhone NSMutableArray Memory Leak

Xcode Instruments claims that the below code results in memory leak. As far as I understand, the following happens when assigning a property: * The old value is autoreleased * The new value is retained * The new value is assigned obviously With that it mind, how come I have a memory leak and how do I resolve it? "TestProjectViewContro...

Instruments says I have 12 memory leaks in this, how do I get rid of them?

I am honestly not able to figure out when to releas these objects, Please help + (DrawData*) load { DrawData *newDrawData = [[DrawData alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *doc...

Django memory leak when linking one-to-one fields.

I have a model that contains one-to-one fields to other models. I over rid the save method to automatically assign these one-to-one fields. The problem is whenever I save this model, memory usage goes up by about 450k and is never released. The save method is as follows: class Link(models.model): id = models.CharField(max_length=11, ...