memory

Memory corrupt in adding string to vector<string> loop

This is on Visual Studio 2008 on a dual-core, 32 bit Vista machine. In the debug code this runs fine, but in Release mode this bombs: void getFromDB(vector<string>& dates) { ... sql::Resultset res = stmt->executeQuery("SELECT FROM ..."); while (res->next()) { string date = res->getString("date"); dates.push_bac...

strtok and memory leaks

hello, I wrote a simple url parser using strtok(). here's the code #include <stdio.h> #include <stdlib.h> typedef struct { char *protocol; char *host; int port; char *path; } aUrl; void parse_url(char *url, aUrl *ret) { printf("Parsing %s\n", url); char *tmp = (char *)_strdup(url); //char *protocol, *host...

Guidance on optimising Python runtime for embedded systems with low system resources

My team is incorporating the Python 2.4.4 runtime into our project in order to leverage some externally developed functionality. Our platform has a 450Mhz SH4 application core and limited memory for use by the Python runtime and application. We have ported Python, but initial testing has highlighted the following hurdles: a) start-...

Is this an efficient use of UIImage?

Let's say I have an object called Person. Person internally loaded an UIImage called "person.png". In my app i create many Person objects, creating and even deleting them at runtime. Since a Person object internally has a retained reference to UIImage, does this mean each Person has a unique memory allocation for the image? Or do all ...

PHP using too much memory

I'm getting the following error when trying to run a php script I wrote: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 56320 bytes) in /home/evergrf2/public_html/ianburris/p/maptile/mapfetcher.php on line 43 What confuses me is that it says the allowed memory size is 33554432 bytes and that...

Adobe AIR - Weird Framerate / Memory Issue (Maybe startAtLogin issue? )

Hi All, I am creating a slideshow application where it loads all the slide data from xml and external images / text files and dynamically creates the slides. The problem that I am having is that when I test the app on my machine it works perfectly fine, every time, however when I place them in the clients machines (the presentation is ...

Memory leak tool for C++ under Windows

I need a recommendation of a free tool (even for a trial) for detecting memory leaks in C++ under Windows (Visual Studio 2005). I've looked in the net, but I would prefer a recommendation. ...

Adobe Flex App page file usage going through the roof!

I have been working on an Adobe Flex application for some months now, and the application is meant to run 24/7 for days (weeks!) continuously. However, I'm now seeing that after a few days of running nonstop the computer it runs on tells me that the system is low on virtual memory and gives me an error about Page File usage. Once I clo...

Under what conditions can the object at an address change? (obj-c)

I have a controller with a delegate. @interface MyConversionController : NSObject { id <ConversionDelegate> _delegate; } @property (assign) id delegate; @end @implementation @synthesize delegate = _delegate; @end I'm getting Unrecognized selector sent to instance 0x36c4a0 errors. I've set a breakpoint on the -(void)setDelegat...

Sharing Memory Between CGImageRef and UIImage

Is there any way to create a UIImage object from an offscreen surface without copying the underlying pixel data? I would like to do something like this: // These numbers are made up obviously... CGContextRef offscreenContext = MyCreateBitmapContext(width, height); // Draw into the offscreen buffer // Draw commands not relevant... // ...

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 usage, SortedList vs List problem

I was using SortedList() in a class which stores about 15-100K data. Recently my requirements changed, data should not be stored as sorted any more so I switched to List(). However in this case I noticed that List() consumes about 20%+ more memory. 9K items: SortedList: 105MB List: 125MB 15K items: SortedList: 115MB List: 140...

Is it possible to call GC in Android?

Hi Im wondering if there is a way to call gc from code, hopefully to free some memory... ...

Memory issue in iPhone OS

I'm facing some sort of memory related issue I cannot figure out. In a summary view, I'm creating a tableview populated by an array (sectionArray) which in turn is loaded from a core data repository. This array of NSManaged objects is used to assign values to a custom UITableViewCell which has two labels: title and description. When ...

Memory issue in iPhone OS (shorter version)

I'm facing some sort of memory related issue I cannot figure out. I have one summary view that lists some settings and a detail view where you can edit each setting. In the summary view I have a tableview populated by an array (settingArray) of settings which in turn is loaded from a core data repository. // SettingsViewController.h...

Large Memory Usage on Small Server (Optimization Question)

I have an application that analyzes data from input files that are generated by our core system. Depending on the client, that file can vary in size (files contain online marketing metrics such as clicks, impressions, etc..). One of our clients has a website that gets a fairly large amount of traffic, and the metric files generated are...

Clearing up large fields from memory in long lived objects

.NET 3.5, I've got some classes which stores up to 1MB of strings. Even though I need the object for a really long time I don't need to store the string for a long time. How can I truly remove the string from memory without disposing the parent object. Is it a good practice to use "myString = null" in this case? or shall wrap it in a ...

Copying data from a running ruby script

Hi, I have a long running ruby script, in Linux, which has some interesting data stored in a hash table. The program does not have any persistence mechanism and I am interested in copying the data from it's hash table. Is there any way to copy data from the memory of a running ruby script? raj ...

Jquery + Chrome memory issue

I'm running this script in Google Chrome while using the Chrome Task Manager to monitor memory usage: <html> <head> <title>Test Page</title> <script type="text/javascript" src="jquery-1.3.2.js"></script> <script type="text/javascript"> var count = 0; function incrementContent() { $("#content").t...

How to dispose a Writeable Bitmap? (WPF)

Some time ago i posted a question related to a WriteableBitmap memory leak, and though I received wonderful tips related to the problem, I still think there is a serious bug / (mistake made by me) / (Confusion) / (some other thing) here. So, here is my problem again: Suppose we have a WPF application with an Image and a button. The ima...