memory-leaks

JavaScript memory problem with canvas

I'm using getImageData/putImageData on a HTML5 canvas to be able to manipulate a picture. My problem is that the browser never seems to free any memory. Not until I close the tab (tested in Chrome and Opera). Moved these out of the function: var ctx = document.getElementById('leif').getContext('2d'); var imgd = ctx.getImageData(0,0...

When process exit, will the memory that's left undeleted be returned to OS?

I am wondering if i new some object but forget to delete it, when the process exit, will the leaked memory be returned to the OS? ...

Weak event handler model for use with lambdas

OK, so this is more of an answer than a question, but after asking this question, and pulling together the various bits from Dustin Campbell, Egor, and also one last tip from the 'IObservable/Rx/Reactive framework', I think I've worked out a workable solution for this particular problem. It may be completely superseded by IObservable/Rx/...

How to solve QPixmap::fromImage memory leak?

Hello everyone! I have a problem with Qt. Here is a part of code that troubles me: void FullScreenImage::QImageIplImageCvt(IplImage *input) { help=cvCreateImage(cvGetSize(input), input->depth, input->nChannels); cvCvtColor(input, help, CV_BGR2RGB); QImage tmp((uchar *)help->imageData, help->width, help->height, help->w...

Memory leak using multiple boost::connect on single slot_type

Hi, I'm using boost::signals and leaking memory when I try to connect multiple signals to a single slot_type. I've seen this same leak reported on various forums, but can't find any that mention the correct way to do this, or any workaround. What I am trying to do: I am trying to pass the result of boost::bind() into a function. In th...

Memory profiling for Java desktop application

Hi, My application loads a data set of approx. 85bm to 100mb each time. The application's memory limit is set to 512mb, and this is, theoretically, more than enough. However, I found that if, in a single run of the application, I opened and closed the data set 5 times, the total memory consumption steadily increases, until I get an out...

Tracking down cocoa memory leaks

I'm getting reports of memory leaks in my app, but I can't track down exactly what is happening. I have a function which takes out an old view and swaps in a new view. I'm not using NavControllers or any @properties; I'm managing my top-level window directly. -(void)swapInView:(UIViewController*)newViewController { [currentViewer.vi...

game is slow first time and then becomes fast

i have new prob when i load application on device first time game is slow and second time when i start new game without closing application it is faster. now its nothing to do with sound coz having same problem with sound off s well. i think its related to sprite. can anyone help i have no time for research ...

GarbageCollector, Dispose or static Methods?

Hi guys, I developed a few classes last month. They grow big (round 30-40 Methods each class). I never take a thought of Memory Leaks, GarbageColletor or something like this (I must say this is my first own big project). Now I have classes with Methods, 15 Classes Round About, each class min. 20 methods. 50% are Linq-Classes in the DA...

Memory Leak when using for(object in array) with iPhone SDK

Hey Everyone, I am running into some serious memory leaks in one of my applications I am building. I have a UINavigatonController that is inside a UITabBarview. Inside the NavView is a MKMap view. When you click an accessory button on a callout a detail view is loaded. In that detail view I am trying to populate a table from a plist usi...

GCC memory leak detection equivalent to Microsoft crtdbg.h?

After many years of working on a general-purpose C++ library using the Microsoft MSVC compiler in Visual Studio, we are now porting it to Linux/Mac OS X (pray for us). I have become accustomed and quite fond of the simple memory leak detection mechanism in MSVC: #ifdef DEBUG #define _CRTDBG_MAP_ALLOC #define NEW new( _NORMAL_B...

Objective-C code not deallocating memory!

I'm trying to learn Objective-C. I almost finished one excercise but it is not deallocating the memory: This is is what I have: void PrintPolygonInfo() { NSLog(@"--------------------"); NSLog(@" PRINT POLYGON INFO"); NSLog(@"--------------------"); NSMutableArray *array = [[NSMutableArray alloc] init]; PolygonShape ...

Memory leak in VB file reader

I'm currently coding a file reader for fixed-width tables in VB, and the compiled application seems to be sucking down memory like there's no tomorrow. I'm working with a series of ~50 megabyte files, but after running through several, the process starts taking up about 200+ megabytes of RAM, which is way more than it should. I've done ...

XCode 3.2.1 and Instruments: Useless Stack Trace

I've reached the stage where it's time to start tracking down memory leaks and, to my dismay, Instruments is giving me very little to go on (other than the fact that I definitely have leaks). My stack trace contains no information other than memory addresses. Since I'm working on a new project and I've transitioned to version 3.2.1...

LinqToSql InsertOnSubmit memory leak?

I am trying to isolate the source of a "memory leak" in my C# application. This application copies a large number of potentially large files into records in a database using the image column type in SQL Server. I am using a LinqToSql and associated objects for all database access. The main loop iterates over a list of files and insert...

Incomplete Type memory leaks?

Microsoft Visual Studio 2008 is giving me the following warning: warning C4150: deletion of pointer to incomplete type 'GLCM::Component'; no destructor called This is probably because I have defined Handles to forward declared types in several places, so now the Handle class is claiming it won't call the destructor on the given object....

ASP.Net GridView memory leak with large result set?

I have a GridView that is bound to an ObjectDataSource that is calling a Business Service object which returns a List<> of POCO's. Recently my client removed the Page Limit number on the GridView due to their customer's request. This resulted in the GridView displaying over 10K items. When this page is called we're seeing the ASP.NE...

Not calling Delegate.EndInvoke can cause memory leak... a myth?

There have been a lot of discussion around this and everyone tend to agree that you should always call Delegate.EndInvoke to prevent a memory leak (even Jon Skeet said it!). I always followed this guideline without questioning, but recently I implemented my own AsyncResult class and saw that the only resource that could leak is the Asyn...

iPhone - Memory leak while displaying UILabel.

hi, I am using a simple function to display messages to user through a label. The function is as follows: -(void) showMessage:(NSString*) message { Message.text = message; [message release]; } There is no memory leak if I call this function from the main thread. But if I call this function from a separate thread, the instruments m...

Memory leak on return object

I have a hard time grasping this memory leak in my code. Basically it's returning an object containing a object. here's the following code: -(id) getOptions { FileManager *file = [[FileManager alloc] initWithFileName:@"optionsFile.dat"]; Options *options = [[Options alloc] init]; NSMutableArray *fileArray = [[NSMutableArray ...