I've implemented a bit of code from one of the many Apple code examples, but I'm having a bit of trouble, because the retain attribute of one of the properties doesn't appear to be working. Here's the property declaration:
@property (nonatomic, retain) EditingViewController *editingViewController;
And here's the code:
- (EditingViewC...
I have have a class that I wrote, and it seems bigger than it should be. It doesn't extend anything, and has very little going on - or so I thought - but each one is taking up just under 100k100 bytes ( thanks back2dos ). I guess that I don't have a very good understanding of what really affects how much memory an object takes up in AS3...
Currently we are using Rational Purify, however it is a pain to use and we have now reached the stage where we are unable to instrument our applications without changing our development build system.
The our application is statically linked and large. It is also memory hungry, where peak memory usage is often over 3Gb.
Ideally I would ...
I have the following method which is spawned by a call for a new thread (using NSThread):
- (void) updateFMLs {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *temp = [[NSArray alloc] initWithArray:someArrayFromAnotherProcess];
[self performSelectorOnMainThread:@selector(doneLoading:) withObject:temp...
I have a C/C++ program that might be hanging when it runs out of memory. We discovered this by running many copies at the same time. I want to debug the program without completely destroying performance on the development machine. Is there a way to limit the memory available so that a new or malloc will return a NULL pointer after, sa...
I have a navigation controller based application and I'm running into a strange issue where a few of my view controller pushes are causing crashes upon "popping" the view controller.
I've narrowed it down to the line of code that releases the view controller after pushing it on the navigation controller's stack.
My code looks like this...
I have an application where the memory profile looks something like this:
The slow upwards crawl of memory usage is caused by the allocation of lots and lots of small, simple, transient objects. In low-memory situations (This is a mobile app) the GC overhead is noticeable when compared to less restrictive memory amounts.
Since we kno...
My coworkers and I are trying to track a memory issue in an application, and in my research I found a blog entry that talks about how each thread gets a 1MB stack by default. Our application happens to create a lot of threads, and so we wrote a quick test program to make sure we understood exactly what was happening. The test app (C#) ...
Hi,
In a separate library, we have a struct with:
typedef struct bsmat{
int m;
int *n;
double **d;
} bs;
where **d is a array of pointers to double arrays.
bs *new_bs(int n, double **d);
There are two use cases:
(a) The main application allocates multiple double matrices and calls the library to construct the structure.
b = new...
I'm getting an instruments Memory Leak with this iPhone 3.0 SDK code.
I'm using the JSON from http://code.google.com/p/json-framework/
Here is my code:
// .h
@property (nontatomic,retain) NSMutableArray *tweets;
// .m
import" JSON.h"
@synthesize tweets;
...
tweets = [[NSMutableArray alloc] init];
NSURL *url = [NSURL URLWit...
Here is a list of break points to put in ~/.gdbinit that are really helpful in debugging memory problems:
fb -[NSException raise]
fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
#define NSZombies
# this will give you help me...
I have a Java application that is leaking memory. I know which objects are not being freed during garbage collection, but I can't work out what is referencing them.
Is it at all possible to have some sort of visibility of the object graph that is being held internally by the JVM?
It is at all otherwise possible to find out which object...
Hi,
Wanted to know what if there is a relationship between the maximum amount of memory that can be used to map a file through mmap() and the size of the RAM in a linux box. I tried to memory map some files , and I found that I am not able to map any more files when the "Mapped" usage comes close to the "MemTotal" ( viewed via cat /proc...
I'm using an obscure language that doesn't have a native stack type so I've implemented my own. Now, reading on the net i've found a few different approaches to do this.
This is my implementation (psuedo code)
//push method
function Push(int)
{
Increase (realloc) stack by 4 bytes;
Push int into the new memory area;
}
//pop met...
I have an object that is a child of UIImageView. Before all these touches methods, I add this object to the superview and then user moves it. In touchesEnded, sometimes I want to release self. I've tried:
- [self release]
or
- [self removeFromSuperview]
But all these tries end up in exceptions. What's the right way to release self...
I have an NSDate object created by
NSDate *date = [[NSDate alloc] init];
Later, I want to reset the date to the "now", so I thought that
[date init];
or
date = [date init];
might do the job, but they don't. Instead,
[date release];
date = [[NSDate alloc] init];
works. I'm a bit confused about this, since in the documentation ...
Take the following code :
int *p = malloc(2 * sizeof *p);
p[0] = 10; //Using the two spaces I
p[1] = 20; //allocated with malloc before.
p[2] = 30; //Using another space that I didn't allocate for.
printf("%d", *(p+1)); //Correctly prints 20
printf("%d", *(p+2)); //Also, correctly prints 30
//although I did...
There are four ways to dynamic allocate memory, is there differences among the four ways?
first like this:
char *seq=(char *)malloc(100*sizeof(char));
void exam(char *seq){
// using 'seq'
}
second like this:
char *seq;
void exam(char *seq){
seq=(char *)malloc(100*sizeof(char));
// using 'seq'
}
third like this:
char *s...
I am having some problems with memory in Perl. When I fill up a big hash, I can not get the memory to be released back to the OS. When I do the same with a scalar and use undef, it will give the memory back to the OS.
Here is a test program I wrote.
#!/usr/bin/perl
###### Memory test
######
## Use Commands
use Number::Bytes::Human qw(...
I work on a project where there is a huge number of objects being instanced by a few classes that stay in memory for the lifetime of the application. There are a lot of memory leaks being caused with OutOfMemoryExceptions being thrown every now and again. It seems like after the instantiated objects ago out of scope, they are not being g...