memory-leaks

Memory leak in PHP with Symfony + Doctrine

I'm using PHP with the Symfony framework (with Doctrine as my ORM) to build a spider that crawls some sites. My problem is that the following code generates a memory leak: $q = $this -> createQuery('Product p'); if($store) { $q -> andWhere('p.store_id = ?', $store -> getId()) -> limit(1); } $q -> andWhere('p.name ...

Is leaked memory freed up when the program exits?

The title says it all: If I programmed without knowing it a memory leak, and the application terminates, is the memory of the memory leak freed? ...

Freezing Eclipse

I use Eclipse for programming in PHP and Java(Android) and sometimes Python, unfortunately Eclipse is nowadays much more often freezing. Often when I write this bracket "[" for defining an array in PHP, Eclipse just freeze and I have to close it manualy and start again. I've noted also, that Eclipse is consuming really much of my RAM... ...

sqlite3 - stringWithUTF8String is leaking!

I would appreciate if someone could help me solve my leaking problem. The leaks occur at: aImage, aCategory, aDescription, category and categories. I release them in dealloc, but obviously that is not sufficient: -(void) readListFromDatabase:(char *) sqlStatement { // Setup some globals databaseName = @"mydatabase.sql"; // ...

BufferedImage.getGraphics() resulting in memory leak, is there a fix?

Hi friends, I'm having problem with some framework API calling BufferedImage.getGraphics() method and thus causing memory leak. What this method does is that it always calls BufferedImage.createGraphics(). On a windows machine, createGraphics() is handled by Win32GraphicsEnvironment which keeps a listeners list inside its field display...

C++ - Is it possible to implement memory leak testing in a unit test?

I'm trying to implement unit testing for my code and I'm having a hard time doing it. Ideally I would like to test some classes not only for good functionality but also for proper memory allocation/deallocation. I wonder if this check can be done using a unit testing framework. I am using Visual Assert btw. I would love to see some samp...

Ways to avoid Memory Leaks in C/C++

What are some tips I can use to avoid memory leaks in my applications? In my current project I use a tool "INSURE++" which finds the memory leak and generate the report. Apart from the tool is there any method to identify memory leaks and overcome it. ...

javascript memory leak

I have a some javascript (used with google maps api) that I am testing on IE and Chrome and noticed memory leak symptoms in IE only: when I refresh the page continuously, the amount of memory used in IE keeps growing (fast), but in Chrome it stays constant. Without posting all of the code (as it is rather long), can I get some suggestio...

Javascript memory leak on page refresh; remedy?

I am experiencing a memory leak in IE that occurs upon a page refresh (as I described in this SO post). All I want to know at this point is: is there a way, on the document "unload" event (which could get called when the page refreshes or closes), to clear EVERYTHING? I'm looking for a simple solution that would ensure that everything...

Running out of memory while analyzing a Java Heap Dump

Hi, I have a curious problem, I need to analyze a Java heap dump (from an IBM JRE) which has 1.5GB in size, the problem is that while analyzing the dump (I've tried HeapAnalyzer and the IBM Memory Analyzer 0.5) the tools runs out of memory I can't really analyze the dump. I have 3GB of RAM in my machine, but seems like it's not enough t...

C++ Dynamic Allocation Mismatch: Is this problematic?

I have been assigned to work on some legacy C++ code in MFC. One of the things I am finding all over the place are allocations like the following: struct Point { float x,y,z; }; ... void someFunc( void ) { int numPoints = ...; Point* pArray = (Point*)new BYTE[ numPoints * sizeof(Point) ]; ... //do some stuff with points...

Memory Leak when using SDURLCache (subclass of NSURLCache)

I am using Olivier Poitrey's SDURLCache (github link) as an alternative to NSURLCache to enable disk-caching in an iPhone app. It works very well but is curiously leaking a NSHTTPURLResponseInternal when a disk cached object is returned (no leak when object is returned from memory or no object found). The following code snippet shows ho...

iPhone app memory leak with UIImage animation? Problem testing on device

I have an animation which works fine in the simulator but crashes on the device. I am getting the following error... Program received signal: “0”. The Debugger has exited due to signal 10 (SIGBUS) A bit of investigating suggests that the UIImages are not getting released and I have a memory leak. I am new to this so can someone tell m...

Potential leak of an object allocated

Using the build and analyze of XCode I saw i have a memory leak in my code: - (NSString *) doIt { NSString *var = [[NSString alloc] init]; return var; } This is of course a simplified snippet of my problem where do i release the object? ...

Entity framework memory leak after detaching newly created object

Hi, Here's a test: WeakReference ref1; WeakReference ref2; TestRepositoryEntitiesContainer context; int i = 0; using (context = GetContext<TestRepositoryEntitiesContainer>()) { context.ObjectMaterialized += (o, s) => i++; var item = context.SomeEntities.Where(e => e.SomePropertyToLookupOn == "some property").First(); conte...

Does remove a DOM object (in Javascript) will cause Memory leak if it has event attached?

So, if in the javascript, I create a DOM object in the HTML page, and attach event listener to the DOM object, upon I remove the the DOM from HTML page, does the event listener still exist and causing memory leak? function myTest() { var obj = document.createElement('div'); obj.addEventListener('click', function() {alert('wh...

How UIWindow#addSubview can make memory leak?

Hello, I started to learn using Instrument, but I cannot figure it out. After I start my application, the UI shows up, I do nothing and after few seconds I can see memory leak detected: When I have a look at the second leak I can see the following stack: When I double click on the cell related to my code I can see that it is pointin...

Should I release NSURL?

Hello, I have the following code: + (BOOL)updateStatus:(NSString *)status forUsername:(NSString *)username withPassword:(NSString *)password { NSURL *loginURL = [NSURL URLWithString:@"XYZ"]; ASIFormDataRequest *loginRequest = [[ASIFormDataRequest requestWithURL:loginURL] retain]; [loginRequest setPostValue:@VALUE forKey:@"SOME_KE...

Is use of LEAKS instrument still common on 3G iPhone?

I'm working with an iPhone 3G, and when I'm trying to investigate memory leaks using the LEAKS instrument, my app crashes. It does not crash when LEAKS is not used. I'm making no claim to having a bug-free or non-memory-intensive app here. But I'd like to investigate leaks on an actual device. When I'm running LEAKS it is incredibly slo...

FileConnection Blackberry memory usage

Hello, I'm writing a blackberry application that reads ints and strings out of a database. This is my first time dealing with reading/writing on the blackberry, so forgive me if this is a dumb question. The database file I'm reading is only about 4kB I open the file with the following code fconn = (FileConnection) Connector.open("file...