memory-management

iPhone - dealloc - Release vs. nil

Wondering if someone with experience could possibly explain this a bit more. I have seen examples of... [view release]; view = nil; ....inside the (void) dealloc. What is the difference and is one better then the other? What is the best way? When doing retainCount testing I have personally seen nil drop a count from 3 to 0 for me...

Accessor method object management?

After reading the Memory Management Guide I am trying to get my head around what is happening here My understanding "so far" is ... - (EngineClass *)engine { return [[engine retain] autorelease]; } I am returning a pointer to an Engine object. The retain count of the object is incremented to record we are making a new pointer to ...

cooperative memory usage across threads?

I have an application that has multiple threads processing work from a todo queue. I have no influence over what gets into the queue and in what order (it is fed externally by the user). A single work item from the queue may take anywhere between a couple of seconds to several hours of runtime and should not be interrupted while processi...

Allocation of several sounds

I'm not sure if I wrote this code well (get clicks on touching buttons rapidly): #import "iEngineRoomAppDelegate.h" #import "iEngineRoomViewController.h" #import "SoundEffect.h" @implementation iEngineRoomAppDelegate @synthesize window; @synthesize viewController; - (void)applicationDidFinishLaunching:(UIApplication *)application { ...

Does the array size matter in javascript in this case?

I'm creating an array in javascript using item id's from the database whenever a corresponding button is clicked on the page. Each array entry will store a custom object. The id's from the database for a specific can start from any number like 80123 to 80223, for that specific page of data. so the first entry in the array will be like ...

Chaining animations and memory management

Hey Everyone, Got a question. I have a subclassed UIView that is acting as my background where I am scrolling the ground. The code is working really nice and according to the Instrumentation, I am not leaking nor is my created and still living Object allocation growing. I have discovered else where in my application that adding an an...

GC Not Running Often Enough on IIS 7 Application - Windows Server 2008

I have a web application that is eventually running out of memory when it runs on IIS 7 Windows Server 2008. When I attempt to run a memory profiler against the application to determine the leak, it is not reproducible on my development workstation...Windows Vista. The GC collection cycles are not consistent between the server and the ...

Must I retain the date from a UIDatePicker Modal View?

I'm getting crashes from my UIDatePicker view and I think it's because I'm not retaining the pickers selected date. Can anyone tell me if this could be correct? I have a modal view for selecting a toDate and a fromDate range. These values are passed into the modal view and grabbed out of the view when it's dismissed. The view has one UI...

Does malloc/new return memory blocks from Cache or RAM?

Hi, I wanted to know whether malloc/new returns memory blocks from Cache or RAM. Thanks in advance. ...

iphone memory leak with uitableview and sqlite

Hi All, I am having a problem with what I believe is a memory leak which after some time is causing my app to slow down. I have a sectioned uitableview that has sections of 'movie directors' with rows of thier movies in their particular section. To do this I am calling a data object (and passing it the section header) to return that se...

How to pause Garbage Collection in .NET?

I'm running some performance tests on some .NET code that processes lots of data. I want some tests that ensure the garbage collector isn't influencing my results. How do I temporarily pause the garbage collector? ...

General strategy to resolve Java memory leak?

I have a standalone program that I run locally, it is meant to be a server type program running 24/7. Recently I found that it has a memory leak, right now our only solution is to restart it every 4 hours. What is the best way to go about finding this memory leak? Which tool and method should we use? ...

Can I use a memory zone to kill iPhone leaks?

I have a C++ class that I'm using from my Objective-C++ controller in my iPhone app. The C++ class does some calculations on some data, returns a result, and then is done -- but it leaks like crazy. I'm wondering if I can somehow make use of Memory Zones (aka malloc zones aka allocWithZone) to solve this. My idea is to allocate the ObjC+...

Does NSThread have a separate heap? What about pthread (on iPhone)

If I detach an NSThread will Cocoa run it in a separate memory heap or memory zone? For example, if I were to detach a thread, use malloc to create a large buffer, and then let the thread exit, would I get that memory back in some kind of automatic thread cleanup, or would it be leaked? What about if I used a POSIX thread (pthread) inst...

Qt4.5: Implicitly shared QImage: are methods like .bits() always copying (documentation unclarity)

I am writing a Qt application that has to handle big QImage s. QImage uses implicit sharing, which means it reference counts an internal data pointer. Whenever the refcount is > 1 the object counts as "shared" and any even only potentially data modifying call issues a deep copy of the image data. In short: I don't want deep copies to h...

Trying to locate a leak! What does anon mean for pmap?

I'm trying to locate where my memory has gone for a java process running in linux. Someone suggested I use pmap -x to see exactly what the memory is doing. The output is really long but basically a good portion of it is a repeat of this: 00007fbf75f6a000 1016 - - - rwx-- [ anon ] 00007fbf76068000 12 ...

.Net: Prevent an object from being paged out (VirtualLock equivalent)

How would one go about keep an object in memory such that it won't be paged out by the OS in .Net? i.e. Something similar to VirtualLock, but operating on an object, such that if compacting occurs and the object is moved it still would not be paged out, etc.. (I suppose one could pin the object's, determine what pages it belongs to, and...

How to reclaim the memory used by a Java thread stack?

I've been having this memory leak issue for days and I think I have some clues now. The memory of my java process keeps growing but yet the heap does not increase. I was told that this is possible if I create many threads, because Java threads uses memory outside of the heap. My java process is a server type program so there are 1000-20...

How to reduce my flash game's background engine 600MB memory usage peaks?

I'm creating a flash game in actionscript 3 with an infinite universe. Because the universe is infinite the background is created dynamically using the following background engine: BackgroundEngine.as package com.tommedema.background { import br.com.stimuli.loading.BulkLoader; import com.tommedema.utils.Settings; import co...

Why does 'self' protect memory space?

In a navigation based app, I initialize an array in my app delegate without using self. When accessed in the RootViewController's cellForRowAtIndexPath:, all array objects are there and I can see it is an NSCFArray. Once the app loads, I click a table cell and in didSelectRowAtIndexPath:, that same array has a type of NSArray, no object...