memory-leaks

Is this an objective-c memory leak?

I know that if you do the following you most certainly have a memory leak: id foo = [[NSObject alloc] init]; foo = nil; But, what if you're using self.foo, a property with retain? And your code instead looks like the following: foo = [[NSObject alloc] init]; self.foo = nil; Is that still a memory leak since the accessor releases th...

Making sense of the 'leaks' command line utility for finding memory leaks

Hi all, I'm working on tracking down some difficult to find memory leaks in my iPhone program. I'm running a quick test on an app which leaks an NSString object with the following intentionally -incorrect- code: -(void)applicationDidFinishLaunching:(NSNotification *)notification; { NSMutableString *test = [[NSMutableString alloc] i...

SerialPort memory leak in .NET 2.0/3.5

Hello, I'm having a very big problem with the SerialPort class and I need some help to solve this. We're using multiple serialports in a generic list since we need to connect to multiple devices. This is what our basic code looks like... List<SerialPort> ports = new List<SerialPort>(); private void button1_Click(object sender, EventA...

Memory leak in c++

I am running my c++ application on an intel Xscale device. The problem is, when I run my application offtarget (Ubuntu) with Valgrind, it does not show any memory leaks. But when I run it on the target system, it starts with 50K free memory, and reduces to 2K overnight. How to catch this kind of leakage, which is not being shown by Valg...

How to dispose of DOM elements in JavaScript to avoid memory leaks

I have an application that allows a user to view details on a specific case w/out a postback. Each time a user requests data from the server I pull down the following markup. <form name="frmAJAX" method="post" action="Default.aspx?id=123456" id="frmAJAX"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" /> </div> <div> <i...

Track down Memory leaks in a Ruby Script

Hello! I have created a Ruby XMPP Framework called babylon. I have then created a few applications with it and even though they run pretty smoothly, it seems that they're eating my computer memory bit by bit. I suspected leaks, so first, I added this at some point in my code : puts `ps -o rss= -p #{Process.pid}`.to_i As suspected, t...

Is the memory not reclaimed for Delphi apps running on Windows Server 2008 (sp1) ?

We have a D2007 application whose memory footprint grows steadily when running on Windows Server 2008 (x64, sp1). It behaves normally on Windows Server 2003 (x32 or x64), XP, etc... where it goes up and down as expected. We have tried with the included Memory Manager or the latest FastMM4 4.92 with the same results. Has anyone tried t...

Feedback on my first Objective-C code (a QuickLook plugin)

I've written a fairly simply QuickLook plugin, which displays the files of a .torrent file, The complete code is here on Github, and the main file is torrent.m The reason I'm looking for feedback is it's acting slightly weirdly.. After building/installing the plugin (into ~/Library/QuickLook/), and running.. qlmanage -r; qlmanage -p ~...

iPhone Memory Management with UIImage

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage: (UIImage *)image editingInfo:(NSDictionary *)editingInfo { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [self.pickerTrigger setImage:image]; [self.button setTitle:@" " forState:UIControlStateNormal]; [self.button setTitle:@" " forState:...

iPhone - removing subviews from UIScrollView - memory-leak

Hi developers, I am currently working on an application which displays several UIViews in a UIScrollView. This UIScroll is inside a UIViewController. (In a loop I am creating new UIViews with autorelease and add them to the scroll view. Could this be the problem?) When I try to release the viewController all the subviews with their l...

How to avoid Memory Leaks?

What are some tips I can use to avoid memory leaks in my applications? Are there any gotchas or pitfalls that I can look out for? ...

What does "Leak of returned object" mean, from Clang?

Further to this question I've fixed a bunch of memory leaks in BEncoding.m (originally from here) I've fixed all the obvious memory leaks, but Clang has found four "Leak of returned object" bugs, which I'm not sure how to sort: The full messages/appropriate bits of code are: NSMutableData *data = [[NSMutableData alloc] init]; [...

Track down memory leak in WPF

Hi Context: We are building a framework for rapid delivery of WPF applications. This framework uses Autofac as an IoC container and also uses regions from Prism v1. We are scheduling tasks with Parallel extensions from Microsoft. We are facing the following problem: When we boot the application with empty views (so just a shell with re...

Cocoa development: malloc: free_garbage: garbage ptr = 0x18a15e0, has non-zero refcount = 1 error

I'm developing a Cocoa app, and every so often when running my app in Xcode I get the following sorts of messages in the debugging console: <My app name>(952,0xb0103000) malloc: free_garbage: garbage ptr = 0x107b2f0, has non-zero refcount = 1 I turned on MallocStackLogging and NSZombieEnabled and did a malloc_history on a couple of...

Critical Sections leaking memory on Vista/Win2008?

It seems that using Critical Sections quite a bit in Vista/Windows Server 2008 leads to the OS not fully regaining the memory. We found this problem with a Delphi application and it is clearly because of using the CS API. (see this SO question) Has anyone else seen it with applications developed with other languages (C++, ...)? The s...

What's the max. memory available for applications? (getting no more handles error).

In an Eclipse RCP application I am trying to open many editors. It is a basically a tree with lot of nodes each of which opens an editor. When I open in access of 150 to 200 editors and try to open an editor for next treenode it doesn't open. Eclipse console shows "org.eclipse.swt.SWTError: No more handles". However if I close a few of a...

Memory test tool for miniport driver in window 7

Hi, I am testing miniport driver in Window 7 OS i.e., .sys file. And I want to test memory leak for that as I will be having only .sys file so please can you tell me which is the appropriate tool for testing driver in window 7. My email id is [email protected] ...

detecting gdi / user handler leaks in winforms

Hello again, I did nice winforms 2.0 application and it's working great and customers are still happy but unfortunatelly I cannot solve one issue. The problem is that after using app for a couple of hours, gdi user handles number is rising and rising and finally process cannot allocate more objects and app crashes... I'm not doing anyt...

Memory leak in Eclipse RCP applications

How can the memory leak in Eclipse RCP applications detected? ...

How do I Save the Heap (Dump to a File) in Eclipse?

Hi Guys! I'm getting this error when I run or debug my GA/AI from MyEclipse: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space eclipse.ini looks like this: -showsplash com.genuitec.myeclipse.product --launcher.XXMaxPermSize 256m -vmargs -Xms128m -Xmx512m -Duser.language=en -XX:PermSize=128M -XX:MaxPermSize=256M...