memory-leaks

Yet another iphone memory leak cry for help. Looking for advice on next steps.

Hi, I hate having memory leaks and usually pride myself on, blah, blah, blah. Help! The leaks I have aren't crazy big (a few K at max), but I want to remove them for sure. There are two categories of leaks and I've got some screen shots of each from Instrument's Leaks tool. The first is just some odd Java/Web thing that happens withi...

How to kick-ass pass scope through "setInterval"

Dear Masterminds, I'm currently wondering if there is a better solution than passing this scope to the lambda-function via the parameter 'e' and then passing it to 'funkyFunction' using call()-method setInterval(function(e){e.funkyFunction.call(e)}, speed, this) (Minor question aside: I'd been reading something about memory-leaks in ...

Can I trust the stack traces reported by UMDH?

Usually, when tracking down a memory leak in a Visual C++ program, I recompile to make use of all of the good stuff in <crtdbg.h>. Last week, however, I stumbled across UMDH, part of the Debugging Tools for Windows. It can take before/after snapshots of memory usage, and then compare them, allowing you to find your leaks. I assume that...

does android.media.SoundPool cause memory leak?

hi, friends, i found these code may case memory leak on android 2.1 SoundPool soundPool = new SoundPool(10, 7, 0); ... ... soundPool = null; every time after the execution, the MAT pluging tells that two String objects of "android:unnamed_thread" are added to the heap of the process. is that an issue? ...

Memory leaks in UICOLOR color with RGB method

Hi, I have to token the string and get a RGB values to make a UICOlor, below is the code, NSString* text = @"1.0,1.0,1.0"; NSArray *chunks = [text componentsSeparatedByString:@","]; return [UIColor colorWithRed:([[chunks objectAtIndex:0] floatValue]/256.0) green:([[chunks objectAtIndex:1] floatValue]/256.0) ...

How to obtain stacktrace when tracking memory leaks?

Hi, I've written a memory tracking system in c++ using Detours to patch the various memory allocation functions. When I receive a call to malloc in addition to the malloc I also store the stacktrace (so I can pin point the leak). The only reliable way to obtain an accurate stacktrace is to use StackWalk64 (I tried RtlCaptureStackBackTr...

Need help in finding a memory leak in copying Sqlite Database to Mutable array.

I seem to be having a 1.19 KB leak somewhere in the following code. opening up the call tree in instruments, I have narrowed down the leaks to the following: 61.8% of the leaks are coming from +[NSString stringWithUTF8String:] 38.1% of the leaks are coming from +[NSNumber numberWithDouble:] -(void) readMinesFromDatabase { NSLog(@...

java.lang.OutOfMemoryError: unable to create new native thread

i saw comment like this one place i have seen this problem is if you keep creating threads, and instead of calling start(), call run() directly on the thread object. This will result in the thread object not getting dereferenced... So after sometime the message unable to create new native thread comes up on the Sun Java Forums ...

Memory Leak Rails/Delayed Job

What sort of tools are available to monitor memory usage in methods running from delayed_job? I have looked at memorylogic, oink, bleakhouse but they all either seem designed to work with controllers or I am missing something. Any examples of how delayed_job memory leaks (not with the gem itself but the code it is running) are detected ...

I can't understand a leak -- Possibly Instrument fail ?

I'm trying to fix some leaks in an iPhone app, but I'm still fighting w/ one of them. It appears with Instruments, and I can see something like : ImageIO 128 bytes (Leaked Object -> Malloc) But I'm releasing nearly all used object (at least I think), could it be a false positive or some memory leak for the ImageIO library ? I know th...

Memory Leak related with replaceChild

Here is source code of my function: bool FieldModel::updateNode(QDomNode &node,const QString &parent){ QDomElement rootOfTag; rootOfTag=fieldState.firstChild().firstChildElement(parent); qDebug()<<"Before"<<fieldState.toString(); QDomNodeList sameTags=rootOfTag.elementsByTagName(node.firstChild().toElement().tagName()); for...

removeFromSuperview and memory management

Hi guys, I'm new to objective-c and at the moment developing a small application. I have some memory management issues and want to ask this particular question. I have a button, appearance of which I'm changing: for (UIView *subview in button.subviews) { if (![subview isKindOfClass:[UIImageView class]]) // don't remove UIImageView, ot...

Memory Issues: simulated memory warning/didReceiveMemoryWarning

App has 4 view controllers; Menu, A, B and C, and a singleton class to hold data in 4 arrays that are written to disk at app termination. A selection from the Menu creates an instance of A, "a"; a selection from "a" creates an instance of B, "b", and from "b", a selection bring up a modal data entry view "c". I simulate a memory warni...

c++ high memory and cpu

ok well i have a simple game that uses really high of memory and cpu. cpu goes over 44% and memory goes over 5000. here is my code Code how to fix this? EDIT memory: 5000 bytes. cpu: 44% on i5 the program get slower by the time it runs. ...

Database LEAK, when taking a photo. SQLiteDatabase created and never closed. Android, Java, SQLite.

Greetings yet again. I have an minor issue when taking a photo. I have a button that invokes the camera, successfully takes a photo, and returns to my entry form. My only problem is the database leak that occurs when pressing the button to call the camera. My code looks a little something like this. public void takephoto(){ Int...

Newbie leaks that I don't quite understand

After fixing other leaks that Instruments was indicating, I find myself in need for help to find my leaches in the following code: -(void) readHistoryFromDatabase { sqlite3 *database; NSMutableArray *days = [[NSMutableArray alloc] init]; NSInteger currentMonth; int noMonths = 0; int historyCount = 0; NSDateFormatter *date...

Why does a WPF UserControl with a binding not get Garbage Collected?

Our application adds and removes WPF (4.0) UserControls from it's main window, and we've noticed that they are not getting Garbage Collected (via WeakReferences that never return null). It seems that if a UserControl has a binding this occurs, even if the control was never added to the tree. The simplest reproduction in a console applica...

MPMoviePlayerController: high usage of memory (not deallocated)

I'm using a MPMoviePlayerController in my iPhone app to display some short video clips sometimes. I deaclared a Category which ads a couple methods to the class to properly attach its view to a particular view and to remove it from there. I use the notification system to let a class know when the movie has finished playing, then I try to...

Why do neither Visual Studio 8's built-in memory leak detector nor Visual Leak Detector generate output for my C++ code?

I'm running windows XP and Visual Studio 8 on a C++ project. It's obvious from the performance profile of my program that there is a memory leak, and when I downloaded the trial version of Purify it confirmed that I have at least two leaks, although, irritatingly, it would not tell me where they are. However, neither Visual studio's bui...

Python - Threaded program seems to have a Memory Leak?

I am writing a python program that seems to be leaking memory. The program takes in a list of URL's and makes sure their status code is 200. If the status code is not 200, then the script will alert me via email. The script threaded so the URL's can be checked in parallel of each other. I have set the program on a one of our server...