memory

Tracking Memory Usage in PHP

I'm trying to track the memory usage of a script that processes URLs. The basic idea is to check that there's a reasonable buffer before adding another URL to a cURL multi handler. I'm using a 'rolling cURL' concept that processes a URLs data as the multi handler is running. This means I can keep N connections active by adding a new URL ...

java stringbuffer declaration

When I don't include the commented line, prevLineBuffer contains "null." When i do include the commented line it still works, but prints an empty string. Does Java statically allocate space for the declared string and then dynamically allocate space for an additional string in the commented line? Both appear to work... public class Inde...

C++ 2D Dynamic Array

Hi, I am trying to dynamically assign a 2d array to a pointer in a constructor initialize. FooBar::FooBar() : _array( new int[10][10] ) { } int **_array; However this does not work. I understand that multidimensional arrays are allocated a bit differently. Is anyone able to elaborate on this with an explanation? Thanks in advan...

SQL Server 2005 Error 701 - out of memory

I'm currently having following error message when executing a .sql file with about 26MB on SQL Server 2005: Msg 701, Level 17, State 123 There is insufficient system memory to run this query. I'm working with 4GB RAM, 64Bit Windows 7 Ultimate, Core2Duo T6400(2GHz)... Is there a way to execute it without receiving this message (maybe ...

Virtual Database in Memory

Imagine the following: I have a table of 57,000 items that i regularly use in my application to figure out things like targeting groups etc. instead of querying the database 300,000 times a day, for a table that hardly ever changes it's data, is there a way to store its information in my application and poll data in memory directly? Or...

Rational Purify not showing memory leak, run-time errors?

Hello, This might not appear like a programming question, but inherently deals with code. I have a following piece of test-code, which has obvious errors like array index out of bounds, memory leak:- #include "stdio.h" #include "stdlib.h" main() { int i; char *ptr; ptr = (char*)malloc(5); for(i=0;i<10;i++) { ptr[i...

How to work with large bitmap. Rotating and inserting to the gallery.

I need to take a picture with the camera and, if depending on the picture size, rotate it before saving it into the gallery. I'm using Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri); startActivityForResult(imageCaptureIntent, IMAGE_CAPTURE...

STL vector taking up too much memory

Im using a STL vector in my SDL program. and it looks like this: vector< Bullet * > vec; this makes a vector that can contain pointers to Bullet objects. when i run my program i only add one item at a time using: vec.push_back( new_bullet ); (new_bullet is a pointer to a "new" Bullet object. then in a following function i erase an object...

What is an szone_error?

I see this sometimes in xcode console. ...

Reading a process memory

I'm trying to read the process memory of a console program using ReadProcessMemory() API function. Updated Code: HWND hWnd = FindWindow(NULL, "Read Memory Window"); DWORD ProcessId; ProcessId = GetProcessId(hWnd); GetWindowThreadProcessId(hWnd, &ProcessId); HANDLE hProcess = OpenProcess(PROCESS_VM_READ,FALSE, Proce...

Passing data between running PHP scripts

For multiple running PHP scripts to communicate, what is the least memory intensive solution? Monitor flat files for changes Keep running queries on a DB to check for new data Other techniques I have heard of, but never tried: Shared memory (APC, or core functions) Message queues (Active MQ and company) ...

iPhone memory stack issue

I've got a program, which loads the albums artwork in NSOperationQueue and it works like a charm. Memory usage stays under 800 KB, but the overall allocated (and released of course) memory is about 50 MB. My problem is memory rans out and the iPod player is killed by the OS. I've got a memory warning, but I don't have anything to relea...

Reading text files into list, then storing in dictionay fills system memory ? (A what am I doing wrong?) Python

I have 43 text files that consume "232.2 MB on disk (232,129,355 bytes) for 43 items". what to read them in to memory (see code below). The problem I am having is that each file which is about 5.3mb on disk is causing python to use an additional 100mb of system memory. If check the size of the dict() getsizeof() (see sample of output). W...

What to do with error information after stack smashing

I'm experiencing some problems with my C program on Linux. It compiles and runs just fine on Windows. The Linux terminal returns this information: *** stack smashing detected ***: ./student terminated ======= Backtrace: ========= /lib/libc.so.6(__fortify_fail+0x4b)[0xb7e908ab] /lib/lib...

Assembly - Trying to reverse string, but it adds an extra character on the final string.

Hi folks. I'm rather new to Assembly (And programming in general, to be honest). I'm trying to play with the stack. The purpose of this code: Take in a String, limited to 80 characters Reprint the String as entered Print each character as it is pushed to the stack Print each character as it is popped from the stack Print the reversed S...

How to limit Python heap size?

I sometimes write Python programs which are very difficult to determine how much memory it will use before execution. As such, I sometimes invoke a Python program that tries to allocate massive amounts of RAM causing the kernel to heavily swap and degrade the performance of other running processes. Because of this, I wish to restrict ho...

Dealing with dynamic integer types in C?

I'm developing a Python module in C that parses a very efficient protocol which uses dynamic integer sizes. Integers sent using this protocol can range in size from the equivalent of C's 'short' to a 'long long.' The protocol has a byte that specifies the type of variable being sent (from short to long long), but I'm not sure how to dea...

How can I play sound in C#?

I'm trying to make a small game. There is about 20 effect sounds and I combined them all into one mp3 file. My question is: Is there a way to load the mp3 file into the memory and then play multiple sections of it at the same time? Any help is appreciated, thanks you! ...

Can object be forced to be stored in heap?

This is Just for my understanding.Objects which are class members go into heap while local variables and value types got o stack.Is there a usecase and possibilty to push the object to Stack or heap forcibly? ...

Passing multidimensional array back through access members.

I have a class "foo" that has a multi dimensional array and need to provide a copy of the array through a getArray member. Is there a nice way of doing this when the array is dynamically created so I can not pass the array back a const as the array is always being deleted, recreated etc. I thought about creating a new dynamic array to pa...