memory-management

Any ideas for developing a Risc Processor friendly string allocator?

I'm working on some tools to enable high throughput data-oriented development, and one thing that I've not got an immediate answer for is how you go about allocating strings quickly. On risc processors you've got another problem of implementation that the CPU doesn't like branching, which is what I'm trying to minimise or avoid. Also, ca...

What's the purpose of having a separate "operator new[]" ?

Looks like operator new and operator new[] have exactly the same signature: void* operator new( size_t size ); void* operator new[]( size_t size ); and do exactly the same: either return a pointer to a big enough block of raw (not initialized in any way) memory or throw an exception. Also operator new is called internally when I crea...

Memory management, and async operations: when does an object become nil?

I have a view that will be displaying downloaded images and text. I'd like to handle all the downloading asynchronously using ASIHTTPRequest, but I'm not sure how to go about notifying the view when downloads are finished... If I pass my view controller as the delegate of the ASIHTTPRequest, and then my view is destroyed (user navigates...

Problem releasing UIImageView after adding to UIScrollView

I'm having a memory problem related to UIImageView. After adding this view to my UIScrollView, if I try to release the UIImageView the application crashes. According to the stack trace, something is calling [UIImageView stopAnimating] after [UIImageView dealloc] is called. However, if I don't release the view the memory is never freed up...

Memory leak in C++ program.

Thanks guys, for every const char * i went ahead and replaced it with string. THanks again! Could someone help please? :/ (This is not a homework question) #include <iostream> #include <string> #include <vld.h> using namespace std; class Time { private: string dayTime; int hour, minute; public: Time(int hour, ...

Delphi Memory Management

I haven't been able to find the answers to a couple of my Delphi memory management questions. I could test different scenarios (which I did to find out what breaks the FreeAndNil method), but its takes too long and its hard! But seriously, I would also like to know how you all (Delphi developers) handle these memory management issues. M...

App crashes every second time a tableview row is selected in navigation controller setup

Disclaimer first: I'm pretty new to Objective-C and the retain model. I've been developing in a garbage collected .NET environment for the last five years, so I've been spoiled. I'm still learning. I'm having my iPhone app crash with EXC_BAD_ACCESS. It happens in a navigtation controller/tableview setup. When I select a row the first ti...

Can I autorelease an instance of NSProxy?

Does NSProxy really implement -autorelease and -release? If not, do I need to manually dealloc NSProxy instances? (Please assume that I am not using GC). Thanks for clear this up for me. ...

How to get available memory C++/g++ ?

I want to allocate my buffers according to memory available. Such that, when I do processing and memory usage goes up, but still remains in available memory limits. Is there a way to get available memory (I don't know will virtual or physical memory status will make any difference ?). And method has to be platform Independent as its goin...

Memory allocation included in API

If there is the 'struct foo' and an APIs which handle foo, which is more flexible and convenient API? 1) API only initialize foo. User should declare foo or allocate memory for foo. The this style is like pthread_mutex_init/pthread_mutex_destroy. example 1) struct foo a; init_foo(&a);' example 2) struct foo *a; a = malloc(sizeof(st...

Scalable memory allocator experiences

I am currently evaluating a few of scalable memory allocators, namely nedmalloc and ptmalloc (both built on top of dlmalloc), as a replacement for default malloc / new because of significant contention seen in multithreaded environment. Their published performance seems to be good, however I would like to check what are experiences of ot...

nedmalloc: where does mem>=fm come from?

While implementing nedmalloc into my application, I am frequently hitting a situation when nedmalloc refuses to free a block of memory, claiming it did not allocate it. I am using v1.06beta1_svn1151 version. While debugging I have come up to the point I see a particular condition which is failing, all other (including magic numbers) su...

How to swap out a memory block?

How to make a block of memory allocated by malloc() or new: immediately swapped out, or lazily initialized. In fact, I'm trying to reserve an address space. How to accomplish this? PS. How to verify, from the user space, if a memory block is swapped out? ...

iPhone memory managment question

Hi all newbie in iPhone dev thanks to all : Is there a way/ a tool to know how much memory an object uses when it is created while the app is running ? Using thé console for example. Thanks ...

Data disappear tab bar app

Hi all ! I'm in trouble :-) the deal :  I have made a Tab Bar based app, i set up a first UIViewController with a nav controller.  The first controller uses TableView to display Data and push a controller which uses some of the Data in the tableView to display it in UILbel and UITextView. The second controller is made of an Acceleromt...

Objective-C NSArray NEWBIE Question:

Hi I have a weird problems with NSArray where some of the members of the objects in my array are going out of scope but not the others: I have a simple object called Section. It has 3 members. @interface Section : NSObject { NSNumber *section_Id; NSNumber *routeId; NSString *startLocationName; } @property(nonatomic,reta...

Why is my UITableView getting its images messed up?

I'm trying to get my UITableView to show cells with images placed on them (contained in a UIImageView overlaid). I'm wondering why when scrolling up and down, the images look like they're overlaid on top of one another. What can I do in this case for the sake of memory management as well as to fix this issue? ...

Memory management with Objective-C Distributed Objects: my temporary instances live forever!

I'm playing with Objective-C Distributed Objects and I'm having some problems understanding how memory management works under the system. The example given below illustrates my problem: Protocol.h #import <Foundation/Foundation.h> @protocol DOServer - (byref id)createTarget; @end Server.m #import <Foundation/Foundation.h> #import ...

Controlling maximum Java standalone running in Linux

Hi, We've developed a Java standalone program. We've configured in our Linux (RedHat ES 4) cron schedule to execute this Java standalone every 10 minutes. Each standalone may sometime take more than 1 hour to complete, or sometime it may complete even within 5 minutes. My problem/solution I'm looking for is, the number of Java standa...

Does a garbage collector collect stack memory, heap memory, or both?

I read lot of articles about garbage collection and almost all article tells about heap memory. so my question is "garbage collection collects stack memory or heap memory or both". thanks Kalpesh ...