memory-leaks

iPhone development - preventing leaks

Hi When I run my app with Leaks and view the Extended Details for any of the leaks, it takes me to a particular line in my code, but I don't know what to do after that! For instance, Leaks shows a malloc at this line NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; But I do no...

Will this lead to a memory leak in C++?

Hello, I have a C++ memory management doubt, that's (obviously) related to references and pointers. Suppose I have a class Class with a method my_method: OtherClass& Class::my_method( ... ) { OtherClass* other_object = new OtherClass( ... ); return *other_object; } Meanwhile in a nearby piece of code: { Class m( ... ); ...

Leak - GeneralBlock-3584

When i try to check leaks of my iPhone App using Instruments, everything is just fine. Same App on actual real device shows this leak for a few times during the app launch. It is pretty non-deterministic and it happens in system libraries. I tried to google down the solution without a luck. Anyone experiencing the same problems? Anyone k...

How to clean up after using dojo ?

Hi, I have written an app using dojo that allocates a lot of data during its lifetime. Is there a way I can ensure that all the memory has been released when I am done? Is there a method like dojo.data.destroyAllStores() that I can use with the <body onunload> tag? Thanks. ...

Memory leak issue with UIImagePickerController

I'm getting memory leak with UIImagePickerController class. Here's how I'm using it: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:picker animated:YES]; [picker release]; To remo...

Building iPhone Code using xcodebuild and running LLVM/Clang Static Analyzer

I followed the steps here but i'm unable to run static analyzer on my project: Finding memory leaks with the LLVM/Clang Static Analyzer When i try to run xcodebuild on my project (1. Open Terminal, 2. Go to Project Directly, 3. > xcodebuild), i get this error: === BUILDING NATIVE TARGET XProject OF PROJECT XProject WITH THE DEFAULT...

Javascript event handlers always increase browser memory usage

Edit: On further examination Firefox does not seem to be doing this, but Chrome definitely does. I guess its just a bug with a new browser - for every event an I/O Read also occurs in Chrome but not in FF. When I load the following page in a browser (I've tested in Chrome and Firefox 3 under Vista) and move the mouse around the memory a...

.net Garbage Collection and managed resources

Is the memory from primitive data types (int, char,etc) immediately released once they leave scope, or added to garbage collection for later release? consider: For x as integer=0 to 1000 dim y as integer Next If this doesn't add 1000 integers to the garbage collector for clean up later, how does it treat string objects? would this cr...

How do you detect memory leaks on iPhone?

I'm using the Leaks Instruments feature through Xcode to (try and) find memory leaks. I still haven't figured out how to use this program. I click Leaks in the program and see memory increasing as I do various things in the simulator. I have Extended Detail pane displayed. The only thing in Extended Detail pane that references my app i...

Is it acceptable not to deallocate memory

I'm working on a project that is supposed to be used from the command line with the following syntax: program-name input-file The program is supposed to process the input, compute some stuff and spit out results on stdout. My language of choice is C++ for several reasons I'm not willing to debate. The computation phase will be highly...

How to best clean up resources for .NET application?

What are the best way or method of best practise to ensure that a Winforms .NET application releases all the resources it consumed in the lifecycle of its execution? In particular, the release of file handles and images. Thanks. ...

Memory consumption by CHtmlView MDI windows

I have found a problem with the MFC CHtmlView class in an MDI app. Repeatedly opening and closing windows causes a progressive drain on memory. I’ve researched the problem and found the MSDN article about the BSTR problem (http://support.microsoft.com/kb/241750), implemented those fixes, but there is still a large drain occurring. I’v...

Is there a way to monitor heap usage in C++/MacOS?

Hello, I fear that some of my code is causing memory leaks, and I'm not sure about how to check it. Is there a tool or something for MacOS X? Thank you ...

finding the caller of a constructor in C++

Looking for a quick and dirty way to identify the caller of a constructor (or any function for that matter) I am writing macros to help identify memory leaks by dumping the "this" pointers to OutputDebugString. Knowing where ctor and dtor was called from would help identify the problem. tnx \0 ...

Memory Leak in TDictionary - Problems with Workaround?

Hi everybody, I just considered using the new TDictionary type. But On QualityCentral I read about two memory leaks caused by TDictionary: http://qc.codegear.com/wc/qcmain.aspx?d=67355 I just implemented the proposed workaround, basically subclassing TDictionary, overriding the destructor and manually freing the two objects that cause...

memory use in large data-structures manipulation/processing

I have a number of large (~100 Mb) files which I'm regularly processing. While I'm trying to delete unneeded data structures during processing, memory consumption is a bit too high. so, I was wondering is there a way to 'efficiently' manipulate large data, e.g.: def read(self, filename): fc = read_100_mb_file(filename) self.proc...

Memory Leaks in jQuery UI

I have a simple page that consists of a table with three jQuery UI progressbars and an ajax call. The ajax calls out to an empty php file and on success I destroy and recreate my progressbars. It seems simple but running it caused memory leaks in both IE7 and Chrome (although Chrome handled it much more gracefully). Here's my code: <s...

javascript/jquery leaking and crashing browser

Let me just preface by saying it's actually my crappy code that's leaking and crashing my browser, I just thought I better make the languages being used as clear as I could from the outset. I have a test page here and the javascript can be found here. My problem is that when I try and drag and drop either one of the red pieces more than...

COM C# Memory leak Tracing

Is there a way to find out the memory usage of each dll within a c# application using com dll's? Or what would you say is the best way to find out why memory grows exponentially when using a com object (IE. Whether the COM object has a memory leak, or whether some special freeing up of objects passed to managed code has to occur(and/or ...

How built-in WPF controls manage their event handlers to an attached event ?

I know that when you register an object to the mouse's attached events, you have memory leaks. That's why you need to use WeakEvent pattern. I have a problem with this pattern : If you want to use it, you cannot define your handler in the XAML code. To me, it means that every code like this leaks : <SomeControl Mouse.MouseDown="MyHand...