memory

Java Images take up too much memory.

I have a program that uses a lot of images. It loads alot of images from file, and stores them so they are only loaded once. It also creates multiple BufferedImages, about 400x400, there would be no more than 10 of these. The images from file total around 6MB. Each BufferedImage should be approx 400x400x4=640KB. Yet, the memory usage i...

Is there a libc function (or equivalent) to know the current size of the heap?

Is there a libc function (or equivalent) to know the current size of the heap? I have a memory problem in my application, and it seems being able to monitor the heap when I want to would help me find the problem. So is there a way to know the current size of the heap? ...

Class members that are objects - Pointers or not? C++

Hi, If I create a class MyClass and it has some private member say MyOtherClass, is it better to make MyOtherClass a pointer or not? What does it mean also to have it as not a pointer in terms of where it is stored in memory? Will the object be created when the class is created? I noticed that the examples in QT usually declare class ...

c++ string allocation

do I need to take care of memory allocation, scope and deletion about c++ "string" object? for example: #include <string> const char* func3() { string s = "this is a literal string"; return s.c_str(); } string func2() { string s = "this is a literal string"; return s; } const char* func1() { const char* s = "this is a...

Hold an object in the memory for a specific time (C# WinForms application)

Hello, What is the best way to hold an object in the memory for a limited period of time, then to free it? For example, I have a Dictionary<int, string> and I want to keep it for 10 minutes only, and after then to dispose it. How to do that? Thanks. ...

Fatal error: Allowed memory size of 419430400 bytes exhausted (tried to allocate 251268854 bytes) in /home/apartmen/php/HTTP/Request.php on line 1012

Ok, I know how this question has been asked and all. But, heres the thing. I'm already using ini_set('memory_limit', '400M'); The file I'm trying to transfer (to Amazon S3) is 245MB The error msg is weird, says allowed mem of 400MB exhausted when it was trying to allocate 239MB.. isnt that the other way round? The script I'm using is...

Is a 128MB PHP memory limit a lot?

Today I added a new feature in the content management system I'm building. Depending on where you are uploading an image to, PHP will resize the image to fit the designated location. It works quite well, but when I try to upload a larger image, as in a 3MB image, I'm getting a fatal error: Fatal error: Allowed memory size of 134217728 b...

iPhone NSMutableArray and NSKeyedUnarchiver unarchiveObjectWithFile release oddity

I archive an array (NSMutableArray) of custom objects that implement the . Once i load it froma file to a retaining property @property (nonatomic, retain) NSMutableArray *buddies; the release count of the object is 2 (correct, it's 1of autorelease + 1 of retain of the property) but then noone releases it and the retain count becames 1, ...

how to access data that is offset of a register? gdb

Guys, how can i access value of 0x14(%edx)? Thank you ...

deallocating memory for objects I haven't set to null

EDIT: Problem wasn't related to the question. It was indeed something wrong with my code, and actually, it was so simple that I don't want to put it on the internet. Thanks anyway. I read in roughly 550k Active directory records and store them in a List, the class being a simple wrapper for an AD user. I then split the list of ADRecords...

Is it better to preload all the sound files before the start of the game?

Hi, I am building a game with 20 levels and have around 15 music files. Currently I am preloading all the 15 sounds using cocos denshion at the start of the game. However the game crashes after a few levels. I get a 'Program received signal: “0”. Data Formatters temporarily unavailable' error. I assume this is because of lack of memory ...

Showing iPhone Keyboard Eats Large Memory Chunk

Hi all, I've seen several posts with people having this issue but no solutions. Basically clicking a UITextField to show the keyboard for the first time eats up ~4mb of memory (according to the activity monitor) and I never get that memory back (and I need it back :P). I know that UIKit will often take up a large chunk of memory for t...

Iphone Allocation with NSData

Hi - I have a method that downloads many images from the internet, then saves them to the device. Here is the code: -(IBAction) updateImages { for (x=0; x<[imagesToUpdate count]; x=x+1) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init]; NSMutableDictionary *tempDic = [dic objectForKey:[imagesToUpdate objectAtIndex:...

arrayWithContentsOfFile: results in crash.

I am creating an application and I get an EXC_BAD_ACCESS error. CODE @interface DNProjectsCategory : DNCategory { NSArray *projects; } @property(nonatomic, retain) NSArray *projects; @end And: @implementation DNProjectsCategory @synthesize projects; // MEM - (void)dealloc { [projects release]; [super dealloc]; } // INI...

Track a program's memory & CPU usage with perfmon

I'm trying to track a process on system running Windows Vista, I tried creating a user Data Collection Set in Vista's "Reliability and Performance Monitor" (perfmon). What I did is the following: Under "Data Collector Sets" -> "User Defined" -> Right click and "New" -> "Data Collector Set" In the wizard I chose "Create Manually" -...

Open Source Software Transactional Memory

I am looking for open source Software Transactional Memory implementation. A list of such implementations in Java will be helpful. Also please point me to performance benchmark comparisons. ...

Question about cl_mem in OpenCL

I have been using cl_mem in some of my OpenCL boilerplate code, but I have been using it through context and not a sharp understanding of what exactly it is. I have been using it as a type for the memory I push on and off the board, which has so far been floats. I tried looking at the OpenCL docs, but cl_mem doesn't show up (does it?). I...

IE6/7/8 Out of Memory?

I was doing some cross browser testing on certain piece of functionality today, and ran across a rather nifty little gem. In IE8: Out of memory at line: 99 In IE7: Out of memory at line: 100 In IE6: Stack overflow at line: 101 From what I've been able to dig up, most of the time these messages start appearing, it's an issue with havi...

Background image in view controller result in memory increase + UIColor colorWithPatternImage

I tried 2 different methods of creating a background image for a view controller. I have researched this before and came to the conclusion that for good memory practice you should use this method: NSString *path = [[NSBundle mainBundle] pathForResource:@"controllerBackground" ofType:@"png" inDirectory:@""]; [self.view setBackgroundCol...

External memory merge sort

Can anyone point me to a good reference on External Memory Mergesort? I've read the wiki page but am having trouble understanding it exactly. An animation might help but I can't seem to find one. Basically, I know that you have a certain number of blocks on disk, and you can fit a certain number of blocks in memory. Lets say you have...