memory

AVAudioPlayer memory leak

Hi there, I'm stuck on some weird memory leak problem related to the AVAudioPlayer and I need help after trying everything that came to mind. Here is the short description of the problem - code appears right after. I initialize my player and start to play the sound track in an endless loop (and endless loop or one time play did not cha...

What does the Linux /proc/meminfo "Mapped" topic mean?

What does the Linux /proc/meminfo "Mapped" topic mean? I have seen several one-liners that tell me it is the "Total size of memory in kilobytes that is mapped by devices or libraries with mmap." But I have now spent almost twenty hours searching the 2.6.30.5 kernel source code trying to confirm this statement, and I have been unable to...

mmap(2) vs mmap(3)

Does anyone know what the difference between mmap(2) and mmap(3) is? Man section 3 is described as "This chapter describes all library functions excluding the library functions described in chapter 2, which implement system calls." Doesn't mmap(3) perform a system call? Reading the two man pages, I see that mmap(2) seems to accept a m...

LuaJit increase stack/heap size

Hi, I keep getting a out of memory error in LuaJit. How do I increase the stack or heap size? Thanks ...

How to re-load UIView after memory unload?

My main view controller (representing the Main Menu in my app) has a simple UIView with a few sub views. I am using a modal-type design pattern and switch to multiple other view controllers before finally returning to the main menu. The problem is, in my other view controllers (not the main menu one), I often load data-heavy images and t...

Different ways of initializing a Model for a View in ASP.NET MVC

How much is the actual memory / performance gain in an ASP.NET MVC controller when using these two different ways of declaring the Model for a view? User user = userService.GetByID(id); return View(user); or return View(userService.GetById(id)); I'm supposing that the last one is a bit more performant as we do not initialize an obj...

Memory Problem using NSData

this is my code it does not releases memory it reaches to 60 mb and application kills for (int i=0; i<[modelList count] ;i++) { url=@"http://192.168.0.101/images/projectimages/"; url=[url stringByAppendingString:[modelList objectAtIndex:i]]; url=[url stringByAppendingString:@".jpg"]; [[NSURLCache sharedURLCache] setMemoryCapaci...

[Boost BGL] reducing memory requirements for adjacency list

Hi, I'm using adjacency_list< vecS, vecS, bidirectionalS ... > extensively. I have so many graphs loaded at once that memory becomes an issue. I'm doing static program analysis and store the callgraph and flowgraphs of the disassembled binary in boost graphs. Thus I can have several ten thousand functions==flowgraphs and one gigantic ca...

Best performance when using a stretchable UIImage

Hi there, I need to use a stretchable UIImage hundreds of times in my app in multiple UIImageViews. Is it okay to globally reuse the same stretchable UIImage instead of having to recreate them in memory each time I need to add it to a UIImageView? I know [UIImage imageNamed:] caches images for better performance, but this cannot be use...

Using JavaScript with Internet Explorer, how do I clear memory without refreshing the page?

I have an AJAX-based website using JavaScript on the client. Certain operations on the site cache large result sets from service calls in the browser (i.e. hundreds of megabytes). These are throw-away results. They will be viewed for a short time and then need to be cleared from memory. I've written a small test site that loads a b...

app keeps crashing

So i'm almost done creating my iphone app but it keeps crashing. Here are the crash report and the plist. Not sure which one you guys need to help me out on why it keeps crashing.... plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt; <p...

Realloc implementation

I'm writing a simple linked list based memory manager in the form: ...Header|Block|Header|Block... with a used and free list. If the realloc() function was asked to reduce the size of a block, is it okay to overwrite some of the trailing bytes with the header for the newly created block? The documentation I've read suggests this is 'un...

How can I in C# stream.Read into unmanaged memory stream?

I can read unmanaged memory in C# using UnmanagedMemoryStream, but how can I do the reverse? I want to read from a managed stream directly into unmanaged memory, instead of first reading into a byte[] and then copying. I'm doing async stream reading on a large number of requests, so the added memory is significant (not to mention the a...

Python subprocess.Popen "OSError: [Errno 12] Cannot allocate memory"

Note: This question was originally asked here but the bounty time expired even though an acceptable answer was not actually found. I am re-asking this question including all details provided in the original question. A python script is running a set of class functions every 60 seconds using the sched module: # sc is a sched.scheduler i...

Setter: [value copy] or [value release]?

I am a little curious about the last lines in the two examples presented below (i.e. planetName = [value ??????]) My understanding is that the 1st example with the copy is best as that takes a copy of the string object to protect against the original string object being changed elsewhere. I am also a little confused by the last line in ...

Differences in return object pointer?

Can someone explain the difference between these two, the first one is taken from allowing xcode to automatically generate the declaration, the last one is taken from an example in "Cocoa Programming" by Aaron Hillegass. - (NSString*)planetName { return [[planetName retain] autorelease]; } . - (NSString*)planetName { return p...

What's the best way to handle this "try - error - clean -retry" case?

I am trying to load an image in memory but might have memory issues since i have some other images loaded. These images have a "visible" field that dictates whether they are visible or not. Regardless of the visibility i keep them in memory for fast loading (when they become visible again). But since i have many of them in memory i wan...

How much faster is the memory usually than the disk?

IDE,SCSI,SSD,SATA or all of those. ...

How does it know where my value is in memory?

When I write a program and tell it int c=5, it puts the value 5 into a little bit of it's memory, but how does it remember which one? The only way I could think of would be to have another bit of memory to tell it, but then it would have to remember where it kept that as well, so how does it remember where everything is? ...

How to reduce memory consumption in MingW based GUI Application ?

I just noticed the memory usage of a simple win32 C based GUI application with single main window taking around 3 MB memory ( via Task Manager ) I used Dev-c++ and Mingw as compiler , and generated windows application via project wizard. why that so ? is there any way to reduce it ? ...