memory-leaks

Delphi: memoryleak in IdStack, but who uses IdStack?

FAstMM reports a memoryleak from a TIdCriticalSection in IdStack.pas. I understand this is a intentional leak, that is documented in the code. What I do not understand, is why IdStack is included in my project. How can I find out what unit pulls it in? Is there a way of excluding this leak from the report, using the version of fastmm t...

Please help - Memory Leak in WPF

I wrote a very simple newbie app with a 6-sided polyhedron (a "box") which rotates 180 degrees when I click a button. and then rotates back again on the next click. Every rotation grabs another 90MB and it doesn't let go until I close the app. The box is defined in the XAML. The Storyboard, DoubleAnimation and PropertyPath, etc, ar...

Dispose on String^ in CLI?

I have a small memory leak in my code regarding Strings in CLI/C++. I've tried to fix the leak by deleting my unsigned char array, but when I do, I get a Memory Access Violation. I assume this is because the System::String is a ref type, and because of that, the memory is associated with both 'testString' and 'uch' in the code below....

UIViews associated with memory leaks

My GUI for an iPhone app uses numerous UIViews. The user "flips" through these views when they tap a button to go forward or backward. The views are stored offscreen and are added to an actual view only when the program needs to display it. During the flip process, the program tells the parent view (a uiscrollview) to remove any existin...

SQL SERVER 2008 - Memory Leak while storing Millions of records

I need some help very badly. I'm working on a project where a bulk of data is entered all the time. It's a reporting software. 10 Million records in an average is stored per day and it could keep on increasing as users increase. As of now, SQL SERVER CONSUMES 5gb of RAM on the task manager. I have an 8GB ram on my server now. How do o...

WPF RichTextBox tab selection eating up system memory!

Hi I have a TabControl in WPF / MVVM that is bound to an ItemsSource on top of an ObservableCollection. Each tab has its own collections and bindings with components such as Images, Richtextboxes, and user input boxes, and everything seems to work well. However, I have noticed that each time I switch a tab, it uses about 100k of syste...

Memory leak traps in the Java Standard API

What classes of the Java Standard API can cause memory leaks when used in an (not obviously) incorrect way? And how can these memory leaks be avoided/fixed? Example: ObjectInputStream and ObjectOutputStream keep references to all objects they have seen in order to send subsequent occurences of the same object as references rather than c...

Exiting Instruments "Full Screen"

I was doing a memory profile in Instruments for my iPhone app and I pressed the "Full Screen" button in the lower left. The screen went black and I can't make it do anything else. When I power cycle the box I get the splash screen appearing, and then it goes back to black. Please help. Here's a doc showing the button in the lower lef...

Fixing memory leaks in Cocoa/ObjC

I'm having a severe memory leak issue with my program. I'm using Apple's Instruments to track my leaks, and in the first few seconds after my app starts there are hundreds and hundreds of leaks listed. The problem is none of them seem to tell me where the leak is coming from. I've gone through all my classes and made sure that anything ...

Array of pointers causes leaks

Hi I have this code -(void)setUserFilters{ //init the user filters array userFilters = [[NSMutableArray alloc] init]; SearchCriteria *tmpSc= [[SearchCriteria alloc] init]; for(int i=0;i<[searchFilters count];i++) { tmpSc=[self.searchFilters objectAtIndex:i]; if(tmpSc.enabled==TRUE) [userFilters addObject:tmpSc]...

App crashes without Garbage Collection enabled

As the title says, my app crashes when garbage collection is not enabled. The app pops up for a few seconds and then it just crashes, with nothing but this in the debugger console: [Session started at 2009-08-17 15:03:20 -0600.] GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009) Copyright 2004 Free Software F...

[Objective C] Leaks hunting

I'm still working on my leaks problem and I don't know how to solve this one I have leaks on each arrayTmp addObject lines NSMutableArray *arrayTmp= [[NSMutableArray alloc] init]; [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"1", @"value", @"Value 1", @"name", nil]]; [arrayTmp addObject:[NSDictionary dictionaryWithO...

Efficiency of using a Python list as a queue

A coworker recently wrote a program in which he used a Python list as a queue. In other words, he used .append(x) when needing to insert items and .pop(0) when needing to remove items. I know that Python has collections.deque and I'm trying to figure out whether to spend my (limited) time to rewrite this code to use it. Assuming that ...

What types of false positive memory leaks can be reported?

When you look for memory leaks using some kind of "tool" like, for example, WinDbg, GlowCode or even the integrated Visual C++ leak reporter, what types of false positives can be reported? In fact, GlowCode warns you against false positives. Depending on the type of scan that you run, more false positives can appear. With this question...

How do ensure that while writing C++ code itself it will not cause any memory leaks?

Running valgrind or purify would be the next steps But while while writing the code itself how do you ensure that it will not cause any memory leaks? You can ensure following things:- 1: Number of new equal to delete 2: Opened File descriptor is closed or not Is there any thing else? ...

iPhone dev - objects stay until user quits, don't release?

In in my app, say it count downs to something and at the end just beeps forever until the user quits the app, is it safe to say have an NSTimer and never release (or in NSTimer's case, invalidate it) it, since it will need to stay until the user quits the app? ...

Why is my destructor never called?

I have a base class A and a derived class B: class A { public: virtual f(); }; class B : public A { public: B() { p = new char [100]; } ~B() { delete [] p; } f(); private: char *p; }; For any reason the destructor is never called - why? I dont understand this. ...

iPhone Help: Odd Memory Leak In CoreLocation Framework

I've been working to iron out memory leaks in my program and I'm down to a few stragglers. The strange thing is that they're coming from when I use CoreLocation to get a gps location. The code is properly returning the location, but it's leaking all over the place: CFHTTPMessage, CFURLConnection, CFURLRequest, CFURLResponse, GeneralBloc...

How to remove NSString Related Memory Leaks?

in my application this method shows memory leak how do i remove leak? -(void)getOneQuestion:(int)flashcardId categoryID:(int)categoryId { flashCardText = [[NSString alloc] init]; flashCardAnswer=[[NSString alloc] init]; //NSLog(@"%s %d %s", __FILE__, __LINE__, __PRETTY_FUNCTION__, __FUNCTION__); sqlite3 *MyDatabase;...

Objective C Leaks when releasing objects with UITableViewCell

I am running the following code in tableView:cellForRowAtIndexPath: File *file = [[File alloc] init]; file = [self.fileList objectAtIndex:row]; UIImage* theImage = file.fileIconImage; cell.imageView.image = theImage; cell.textLabel.text = file.fileName; cell.detailTextLabel.text = file.fileModificationDate; cell.accessoryType = UITable...