memory-management

iPhone: Newbie memory management question

I am just getting started with cocoa. So please excuse the silly question, but I can't quite wrap my head around some aspects of memory management yet. In the interface of my class I am declaring an object as CEMyObjectclass *myObject;. I do not alloc or init the obect in the classe's init menthod. But I do have a method that calls myOb...

Java memory mapped files and swap

I'm looking at some memory mapped files in Java. Let's say I have a heap size set to 2gb, and I memory map a file that is 50gb - far more than the physical memory on the machine. The OS will cache parts of that 50gb file in the os file cache, the java process will have 2gb of heap space. What I'm curious about is how does the OS decide h...

Opera Mobile, offline web app development, and memory

I'm developing a data collection app for use on a HP iPAQ 211 running Windows Mobile 6. I'm doing it as an offline web app (go with what you know) using Opera Mobile 9.7 and Google Gears. Being it is an offline app, it is very dependent on Javascript for much of its behavior. I'm using the LocalServer, Database, and Geolocation component...

XNA: What is the point of Unload()?

XNA games have an Unload() method, where content is supposed to be unloaded. But what is the point of this? If all the content is being unloaded, then the game must be exiting, in which case everything would be garbage collected anyway, right? ...

What are good memory management techniques in Flash/as3

Hello! So I am pretty familiar with memory management in Java, C and C++; however, in flash what constructs are there for memory management? I assume flash has a sort of virtual machine like java, and I have been assuming that things get garbage collected when they are set to null. I am not sure if this is actually the case though. Also...

Alternative for Garbage Collector

As in question, I'd like to know best alternative for garbage collector, with it's pros and cons. My priority is speed, memory is less important - if there is gc which doesn't make any pause, let me know. EDIT: maybe I should add, that I'm working on safe language, and garbage collecting or its alternative has to be used ...

System.OutOfMemoryException on file download

I have an ashx handler with the following code. The idea is to hide the path of the file and prompt a download context.Response.Clear(); context.Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName); context.Response.AddHeader("Content-Length", file.Length.ToString()); context.Response...

mprotect - how aligning to multiple of pagesize works?

Hi, I am not understanding the 'aligning allocated memory' part from the mprotect usage. I am referring to the code example given on http://linux.die.net/man/2/mprotect char *p; char c; /* Allocate a buffer; it will have the default protection of PROT_READ|PROT_WRITE. */ p = malloc(1024+PAGESIZE-1); if (!p) { perror("Couldn't m...

C++ Memory Leak, Can't find where

I'm using Visual Studio 2008, Developing an OpenGL window. I've created several classes for creating a skeleton, one for joints, one for skin, one for a Body(which is a holder for several joints and skin) and one for reading a skel/skin file. Within each of my classes, I'm using pointers for most of my data, most of which are declared u...

quick question about memory management in AS3

the following method will be called many times. i'm concerned the continuous call for new rectangles will add potentially unnecessary memory consumption, or is the memory used to produce the previous rectangle released/overwritten to accommodate another rectangle since it is assigned to the same instance variable? private function onDr...

Stack storage at function call

When we call a function (let say with 3 parameters), how are the variables are stored in the stack memory. ...

Garbage collection - manually wiping EVERYTHING!

I have been building a game for a while (nearly done) - But the game needs a replay button and its a big task. I know the GC is dreadful in flash, but I wanted to know if there is a way to wipe EVERYTHING as if the flash app has just begun. Clearing memory, game data - I haven't to worry about game loading as its not really heavy on dat...

iPhone, memory / autorelease objects.

I am a little concerned about building up a large amount of autoreleased objects on the iPhone. My application is only simple so it should not be an issue, but I just wanted to check that methods (like below) are correct and acceptable -(NSNumber *)numberFromCore { NSNumber *removedNumber = [[dataCore objectAtIndex:0] retain]; [...

How can I give eclipse more memory than 512M?

I have following setup, but when I put 1024 and replace all 512 with 1024, then eclipse won't start at all. How can I have more than 512M memory for my eclipse JVM? -startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519 -product c...

Obj-C memory management: why doesn't this work?

Why doesn't the following code work? MyViewController *viewController = [[MyViewController alloc] init]; [myWindow addSubview:viewController.view]; [viewController release]; As I understand, myWindow should be retaining viewController.view for as long as the window needs it. So why does this cause my app to crash on launch? (commentin...

How does memory protection in SASOS works?

I'd like to know how it works - whether it checks if process can read/write/execute memory on every access, or it does it only once? But when it does it only once, and all processes are in a single address space, how are these other hostile processes are prevented from accessing memory from not their's areas? How is it solved in Mungi OS...

How to prevent latex memory overflow

I've got a latex macro that makes small pictures. In that picture I need to draw area. Borders of that area are quadratic bezier curves and that area is to be filled. I did not know how to do it so currently I'm "filling" the area by drawing a plenty of bezier curves inside it... This slows down typeseting and when a macro is used multi...

dynamic memory for 2D char array

I have declared an array char **arr; How to initialize the memory for the 2D char array. ...

dynamic memory allocation

When we dynamically allocate memory, does the memory occupies the continuous memory segment. ...

Can a variable bu used 2nd time after releasing it?

Hello, I try to understand the memory management in ObjectiveC and still some things are a misery for me. I've got an instance variable: NSMutableArray *postResultsArray; when a button is clicked in the UI I create new array: self.postResultsArray = [NSMutableArray array]; then I add some objects to the array and when the who...