memory-management

iphone app with multiple views/subviews: memory is not being deallocated

Hello I have an iPhone application that loads succesive views in a framework based on the one explained in this link (basically a main ViewController that loads/removes additional views with a displayView method). In my application I am using NIBs (the example link uses coded views) though so each of my ViewControllers has its accompany...

Tell tale sign of memory fragmentation (as opposed to a memory leak)?

First I realize that leaks can fragment memory badly, but please bear with me. Using WinDbg and attaching to a process: Using !heap (or another WinDbg command), what should I expect see if I'm dealing with memory fragmentation as opposed to a leak? For instance, I can use "!heap stat" and "!heap stat -h handle" to zero-in on the code...

What is the state of the art in Memory Protection?

The more I read about low level languages like C and pointers and memory management, it makes me wonder about the current state of the art with modern operating systems and memory protection. For example what kind of checks are in place that prevent some rogue program from randomly trying to read as much address space as it can and disre...

What are some tools that can analyse memory usage outside of the heap in Java?

We have weird memory leak problem with a Java process running in linux has an ever growing swap usage. So naturally we looked at the heap dump and also used a profiler to monitor it over a period of time. We found that 1) The number of threads does not grow 2) The heap usage does not grow 3) Yet the (VIRT) usage keeps growing (which ca...

Comparing performance between ruby and python code

I have a memory and CPU intensive problem to solve and I need to benchmark the different solutions in ruby and python on different platforms. To do the benchmark, I need to measure the time taken and the memory occupied by objects (not the entire program, but a selected list of objects) in both python and ruby. Please recommend ways to...

How to set the maximum memory usage for JVM?

I want to limit the maximum memory used by the JVM. Note, this is not just the heap, I want to limit the total memory used by this process. ...

When to release CATransition animation? (iphone)

Hey, i am using this code to animate something CATransition *animation = [CATransition animation]; [animation setDuration:0.45f]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromRight]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]]; [[theWindow la...

Determining size of bit vectors for memory management given hard limit on memory.

After searching around a bit and consulting the Dinosaur Book, I've come to SO seeking wisdom. Note that this is somewhat homework-related, but actually isn't a homework problem. Also, this is using the C programming language. I'm working with a kernel that currently allocates memory in 4K chunks. In an attempt to cut down on wasted mem...

Even with self, object still autoreleased

In regards to this posting http://stackoverflow.com/questions/1481871/why-does-self-protect-memory-space/1481882#1481882, I'm using 'self' to access aArray. Yet, I still get an invalid object in the didSelectRowAtIndexPath: method. In the root controller, I access aArray like this: MyAppDelegate *theDelegate = [[UIApplication sharedAp...

How long can memory leaks persist in RPGLE programs?

I'm putting into production some RPGLE code which uses %alloc and dealloc to allocate memory. Programmers should be able to ensure there are no resulting memory leaks but I'm worried about what happens if they don't. My question is: if programmers mess up and there are memory leaks then when will this memory be reclaimed? Is it when ...

Heap corruption: What could the cause be?

Hi, I am investigating a crash due to heap corruption. As this issue is non-trivial and involves analyzing the stack and dump results, I have decided to do a code review of files related to the crash. To be frank, I don't have in-depth knowledge of when the heap could be corrupted. I would appreciate if you could suggest scenarios whi...

Dot notation dealloc?

@property (copy) NSString *name; @property (copy) NSString *orbit; @property (copy) NSNumber *mass; @property float surfaceTemp; @property float rotationSpeed; Currently Have this - (void)dealloc{ [name release]; name = nil; [orbit release]; orbit = nil; [mass release]; mass = nil; [super dealloc]; } If I...

What Determines Memory Usage on Ubuntu with Rails and MySQL

Forgive the newbie type question but, what determines the RAM consumed by rails and MySQL (my server is Ubuntu)? With barely any requests coming in the server seems to be hovering around 1.5 of 2GB. MySQL has about 100MB of data stored in it. The site has about 3500 registered users and when trafic is high, the memory tends to peak aro...

Memory mapped - partially disk based algorithms

Are there any good resources or books for spillable data structures, ie say a queue, when storing large objects it could fill up all of memory, but if you can keep say the most used items of that queue structure in memory and the rest on disk (sort of like paging), similarly this question applies to other structures such as linked lists,...

memory handling in c# windows application

Hi, I've a windows forms application. When i try to run this application it is increasing mem Usage continuously. How can i control this? just my application contains only 10 to 15 database calls. Code from comment to answer (there's no context though): Label lbl = new Label(); lbl.Text = "my data label"; lblrss.Font = new System.Draw...

Help understand C Stack

I am trying to understand low-level memory manager in C especially Stack. As I was told, when a function is called, a return address was push on a stack. Then local variables is located after that. So I write a small program to investigate this. Here is my program: #include <stdio.h> void TestStack(); void DoTestStack() { char x1...

malloc property objective c

Currently I am using NSMutableArray as a property. However I am also using opengl and for performance purposes I want to use malloc to create an a pointer to the int array and have this as the property. How would I do this in objective c and still make sure that my memory is safe? Perhaps this is not even a safe thing to do in objecti...

Am I really leaking memory?

In Xcode I run the program I wrote with the leaks instrument It says leaks are discovered and the total leaked bytes keeps rising. I look at leaked objects and none of them seem to be from my program. For example QuartzCore OpenGLES libLLVMContainer.dyl libCoreVMClient.dylib libGFXShared.dylib Is it my fault that the program is leaki...

UIView continues to exist after removeFromSuperview

I add a firstView in the AppDelegate : #import "TestViewAppDelegate.h" #import "MainViewController.h" @implementation TestViewAppDelegate @synthesize window; @synthesize mainViewController; - (void)applicationDidFinishLaunching:(UIApplication *)application { MainViewController *aController = [[MainViewController alloc] initWit...

C# DataGridView clean up

I have a BindingList which is the data source for a Bindingsource, which in turn is a data source for a DataGridView. (The objects are purely managed, and do not have anything that requires calling .Dispose().) When I wish to clear the list, and hence clear the grid, I am simply calling BindingSource.Clear(), which as far as I can tell...