memory-leaks

How can i see if dealloc is being called on a uikit object, or any object not created by myself

I think i have an UIImage that has a higher retain count than it should have and i am probably leaking memory. I use this image as a thumbnail, to set a custom background to a uibutton. So the uibutton is holding a reference to it and so do i. But instead of 2, the retainCount is 3. Do i have to create a custom UIImage derived class and ...

Advice using leaks in instruments for noobs

Hello I am pretty new to iphone development. I have run my app for the first time using the "Leaks" from "Instruments". It shows me several leaks around 20 the smallest is 32 bytes and there is one with 1KB. I have followed the memory management guidelines, (i (think i) understand how and when to use release, not to use it when adding to...

PHP Possible Memory Leak

I have a script that loops through a database for images to convert with gd & imagick. I unset or replace all variables and objects in between each loop. For each loop, get_memory_usage(1) reveals a concurrent amount of memory used by that script. Which is expected. But, when I run "top", the %MEM column reports that this script, (sam...

Will this be garbage collected in JVM?

I am running the following code every two minutes via a Timer: object = new CustomObject(this); Potentially, this is a lot of objects being created and a lot of objects being overwritten. Do the overwritten objects get garbage collected, even with a reference to itself being used in the newly created object? I am using JDK 1.6.0_13. ...

Loading animation Memory leak

Hi, I have written network class that is managing all network calls for my application. There are two methods showLoadingAnimationView and hideLoadingAnimationView that will show UIActivityIndicatorView in a view over my current viewcontroller with fade background. I am getting memory leaks somewhere on these two methods. Here is the cod...

How to put your application on your iphone?

So I made my first iphone application; I want to test for memory leaks and the general feel and design of the user interface, so how do I put it on my iphone? ...

NSURLConnection shown as leaking in instruments

Hello another stupid question regarding leaks and also NSURLConnection. How do i release it? Is it enough if i release in the following 2 methods? (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error (void)connectionDidFinishLoading:(NSURLConnection *)connection Because in instruments it shows me the line...

iPhone UIGraphicsGetImageFromCurrentImageContext memory leak

My iPhone application downloads image files from a server, stores it into NSTemporaryDirectory() and then loads the image in the UI asynchronously. Code flow is like this: Show view with loading activity indicator and run a image downloader in the background. Once the image is downloaded, it is written to a file. A timer in the loading...

Why no memory leak?

The following is designed to take a variable length constant char and print it out in a nice format for logging. I am certain readers will have suggestions on how this can be improved, and I'd welcome it. What puzzles me is that I expected it would be necessary to free() the returned static char each time ToHexString() is called. Inst...

Jquery auto refresh div

Jquery auto refresh is using up a LOT of browser memory. Is there a way to stop this. I had a 2 div refreshing every 3 seconds but I moved it up to 9 and 15 seconds, It helped a little bit the longer the window stays open on my site the more memory it takes until finally the browser crashes. <script type="text/javascript" src="http://aj...

Under Linux, how do I track down a memory leak in pre-built software?

I have a new Ubuntu Linux Server 64bit 10.04 LTS. A default install of Mysql with replication turned on appears to be leaking memory. However, we've tried going back to an earlier version and memory is still leaking but I can't tell where. What tools/techniques can I use to pinpoint where memory is leaking so that I can rectify the p...

In Internet Explorer, why does memory leak stay, even when navigating away from pages?

The book Learning jQuery says IE has memory leak for the DOM object having a property referencing a function, and the function also referencing the DOM object, thus having a "circular reference", like this: onload = function() { var foo = document.getElementById('foo'); foo.onclick = function() { // DOM object foo's onclick pro...

COM class Returning byte[] in .NET - Whether to release memory or not

I have a COM component having a MyDataObject class. There is a method with the following signature: HRESULT MyDataObject::GetData(long Format, VARIANT* retval) This COM object is used in a .NET application and the method returns either a string or byte array depending on Format value. The returned value is converted to a byte[] in .NE...

ruby gtk memory leak on image overlays

Okay: I'm on a linux system, so if you are windows I'm sure you can figure out how to do the equivalent of some of the actions I describe below Create 'test.svg' as such: <svg> <circle cx="100" cy="100" r="100"/> </svg> Now create this little ruby script: #!/usr/bin/env ruby require 'gtk2' Gtk::init pixbuf = Gdk::Pixbuf.new "test...

preventing memory leak (case-specific)

Consider the following situation: SomeType *sptr = someFunction(); // do sth with sptr I am unaware of the internals of someFunction(). Its pretty obvious that the pointer to the object which someFunction() is returning must be either malloc'ed or be a static variable. Now, I do something with sptr, and quit. clearly the object be st...

Objective C difference between self.variable and variable assignments.

I fear I am being stupid. I've spent about three hours tracking down a memory leak that's been destroying my sanity and after commenting out half my app I have come to the following conclusion. Given the following in the right places. NSString *blah; @property (nonatomic, retain) NSString *blah; @synthesize blah; -(id)initWithBlah:...

Leaks in NSURLConnection

Hi, I have googled a lot and read a lot about the leaks issue with NSURLConnection, but none of them gives a definite answer as to what is the solution to overcome these leaks. I create an asynchronous connection and every time the connection is established, I get a GeneralBlock-3584 leak. Sometimes the responsible library is shown to b...

Returning an NSArray without Leaking?

I have been struggling with the best pattern for returning an array from a static method. In my static method getList (in the BIUtility Class), I am allocating an NSArray to return. in the return line, I do: return [array autorelease]; Then in the calling method, I am allocating an array like this: NSArray * list = [[[NSArray alloc...

System.OutOfMemoryException being thrown

I am getting a system.outofmemory exception in my code: While r1.Read() menu1id = r1("id") db.AddInParameter(command2, "@menu1id", DbType.Int32, menu1id) r2 = db.ExecuteReader(command2) command2.Parameters.Clear() menu1heading = r1("Headi...

NSMutableArray Leaks in Loop

Hi, I´m using instruments to find memory leaks, and it found a lots! But i don´t know how to fix it. @property(nonatomic, retain) NSMutableArray *wycategories; ... ... self.wycategories = [[NSMutableArray alloc]init]; ... ... for (CXMLElement *node in nodes) { //Instruments say that here there are a lots of memory leaks Wa...