memory

Need to iterate through SQL table rows, one at a time (table too big to use adapter.Fill)

It's easy enough for me to read through a small SQL Server 2005 table like this: string cmdText = "select * from myTable"; SqlDataAdapter adapter = new SqlDataAdapter(cmdText, connection); DataTable table = new DataTable(); adapter.Fill(table); Unfortunately, this method appears to load the entire table into memory, which simply isn't...

memmove, memcpy, and new

I am making a simple byte buffer that stores its data in a char array acquired with new and I was just wondering if the memcpy and memmove functions would give me anything weird if used on memory acquired with new or is there anything you would recommend doing instead? ...

How does OS handle a python dict that's larger than memory?

I have a python program that is going to eat a lot of memory, primarily in a dict. This dict will be responsible for assigning a unique integer value to a very large set of keys. As I am working with large matrices, I need a key-to-index correspondence that can also be recovered from (i.e., once matrix computations are complete, I need...

How to analyze Heap Dumps

Hi Guys, I am successful in generating Heap Dumps of my application machine but I do not know how to analyze it. Can someone tell me how to? Thanks and Regards, Deepti ...

Block Access to physical address on Windows

I'm accessing my memory-mapped device via a device-specific physical memory on the PC. This is done using a driver that maps a specific physical address to a pointer in linear memory on my process address space. I wanted to know if there is any way I can obtain a block the specific physical address and prevent other processes or devices...

C++ freeing static variables

Hi all, I would like my class to have a static pointer to a dynamically allocated region of memory. I understand how to initialize it - in my case I will initialize it when the first object needs it. However, I don't know when/where in the code to free it. I'd like to free it when the program terminates. I might be able to free the ...

How to allocate more memory for a buffer in C++?

I have pointer str: char* str = new char[10]; I use the memory block str points to to store data. How can I allocate more bytes for the buffer pointed to by str and not lose old data stored in the buffer? ...

In 64 bit systems, a 32 bit variable occupies less space than a 64 bit object?

The .NET Framework allocates less memory for a Int32 than for a Int64 in 64 bit systems? ...

Faulting DLL (ISAPI Filter)...

I wrote this ISAPI filter to rewrite the URL because we had some sites that moved locations... Basically the filter looks at the referrer, and if it's the local server, it looks at the requested URL and compared it to the full referrer. If the first path is identical, nothing is done, however if not, it takes the first path from the fu...

Locating objects (structs) in memory - how to?

Hi, How would you locate an object in memory, lets say that you have a struct defined as: struct POINT { int x; int y; }; How would I scan the memory region of my app to find instances of this struct so that I can read them out? Thanks R. ...

memory (leaks) after executing

I'm wondering why randomly after executing the ./a.out I get the following. Any ideas what I'm doing wrong? Thanks http://img710.imageshack.us/img710/8708/trasht.png ...

How can I tell the size of my app during development?

My programming decissions are directly related to how much room I have left, or worse perhaps how much I need to shave off in order to get up the 10mb limit. I have read that Apple has quietly increased the 3G & Edge download limit from 10mb up to 20mb in preparation for the iPad in April. Either way, my real question is how can I ga...

Loading MachineCode From File Into Memory and Executing in C -- mprotect Failing

Hi I'm trying to load raw machine code into memory and run it from within a C program, right now when the program executes it breaks when trying to run mprotect on the memory to make it executable. I'm also not entirely sure that if the memory does get set right it will execute. I am currently running this on Ubuntu Linux x86 (Maybe the ...

How costly performance-wise are these actions in iPhone objective-C?

This is really a few questions in one, I'm wondering what the performance cost is for these things, as I haven't really been following a best practice of any sort for these. The answers may also be useful to other readers, if somebody knows these. (1) If I need the core data managed object context, is it bad to use #import "myAppDeleg...

memory size exceeded?

i have a form that submits data to a database, i have a function that looks like this: //connect foreach ($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string($value); } now when i post, SOMETIMES i get an error that says this: Allowed memory size of 268435456 bytes exhausted i figured out that when i do a l...

Effect of suffixes in memory to cache operations

In x86 GNU Assembler there are different suffixes for memory related operations. E.g.: movb, movs, movw, movl, movq, movt(?) Now my question is the following: Does the suffix has ANY effect on how the processor is getting the data out of main memory or will always be one or more 32-bit (x86) chunks loaded into the cache ? What are t...

Integer array or struct array - which is better?

In my app, I'm storing Bitmap data in a two-dimensional integer array (int[,]). To access the R, G and B values I use something like this: // read: int i = _data[x, y]; byte B = (byte)(i >> 0); byte G = (byte)(i >> 8); byte R = (byte)(i >> 16); // write: _data[x, y] = BitConverter.ToInt32(new byte[] { B, G, R, 0 }, 0); I'm using inte...

dynamic array pointer to binary file

Hi guys, Know this might be rather basic, but I been trying to figure out how to one after create a dynamic array such as double* data = new double[size]; be used as a source of data to be kept in to a binary file such as ofstream fs("data.bin",ios:binary"); fs.write(reinterpret_cast<const char *> (data),size*sizeof(double)); Whe...

Stack Allocation in C

Is it bad style to design your simple C programs to allocate everything, or most everything, on the stack? ...

Copying an sqlite database from file to :memory using C#

I have a small database with tables containing a small amount of data which I need to copy into memory. Currently I am using: insertcommand.CommandText = "SELECT sql FROM sqlite_master WHERE sql NOT NULL;"; To pull all the table schema from the file database, however I'm not really sure how to proceed with creating these tables in th...