memory

What's the difference between operating system "swap" and "page"?

What is the difference between these 2 terms in Operating System: swap and page? ...

Appending to a serialized collection

I'm having a serialized array of some type. Is there a way to append new objects to this serialized array (in a serialized form) without the need to read the already saved collection into the memory? Example: I'm having in a file.xml, XML-serialized array of Entity containing 10^12 elements. I need to add another 10^5 elements to the s...

Does garbage collector call Dispose()?

I thought the GC would call Dispose eventually if your program did not but that you should call Dispose() in your program just to make the cleanup deterministic. However, from my little test program, I don't see Dispose getting called at all.... public class Test : IDisposable { static void Main(string[] args) { Test s ...

Aligning a class to a class it inherits from? Force all stack alignment? Change sizeof?

I want to have a base class which dictates the alignment of the objects which inherit from it. This works fine for the heap because I can control how that gets allocated, and how arrays of it get allocated in a custom array template. However, the actual size of the class as far as C++ is concerned doesn't change at all. Which is to say i...

MySQL process uses more than 100% CPU usage and need about 1 GB of memory

I am running MySQL server on the server's which has following specifications - Dual Xeon Quad Core 2.0, 2048 MB RAM, 1x 160 GB SATA Fedora Core + SSH But MySQL process for inserting 10000 records take more than 100% of CPU and up to 1 GB of RAM. It's a plain insert statement. Why is MySQL is taking so much of memory and what can done...

iPhone OS memory problem - how to debug?

I have a pretty weird problem in my iPhone app which is, I think, related to memory getting corrupted: At one point, I need to sort an array, which I do with -[sortArrayUsingFunction]. The result is not correct unless I either allocate some memory with something like void *test = malloc(2 * sizeof( int )) before the method call or hav...

Custom malloc() implementation header design

I am trying to write a custom allocator for debugging purposes (as an exercise) in C, where I will be using a single linked list to hold together the free list of memory using the First Fit Algorithm. I've shown below the structure I would like to create in an "Empty Memory Node". How do I write the header block (a union to be specific)...

Loading data to shared memory from database tables

Any idea about loading the data from database to shared memory, the idea is to fasten the data retrival from frequently used tables? ...

How to monitor or visualize memory fragmentation of a delphi application

How can I monitor or visualize memory fragmentation of a delphi application? ...

how do i run valgrind to a process which has super user bit on?

I am running valgrind as follows:- /usr/local/bin/valgrind "process_name" After excecution its giving me following error ==21731== ==21731== Warning: Can't execute setuid/setgid executable: ==21731== Possible workaround: remove --trace-children=yes, if in effect ==21731== valgrind: "process name": Permission denied My valgrind per...

View ram in DOS

Is there a way in dos (im using a dos boot disk on a linux machine) to view portions of ram? ie. some form of command to read the binary at a given address? edit: my bootable floppy doesnt have debug on it. when i type debug it says 'bad command or file name how do i make a bootable dos floppy with debug on it? ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse. ...

Data Destruction In C++

So, for class I'm (constantly re-inventing the wheel) writing a bunch of standard data structures, like Linked Lists and Maps. I've got everything working fine, sort of. Insertion and removal of data works like a charm. But then main ends, my list is deleted, it calls it's dtor and attempts to delete all data inside of it. For some r...

What should I load into memory when my app loads?

I have objects I am saving to the file system using serialization. When I load the app, should I load all the objects into memory or just stubs (for searching capabilities)? If I load just stubs, then I would load them from the file system when they are needed and keep them in memory after that for quick access. The order of magnitude...

how is read-only memory implemented in c?

I heard that in c, if I do: char *s = "hello world". The "hello world" is actually stored in read-only memory. I am not so clear about read-only memory. Can anybody explain? Is that like a flag to compiler that tells compiler that do not write into that section? ...

file scope and static floats

Hello there. I've run into an interesting problem in an AI project of mine. I'm trying to format some debug text and something strange is happening. Here's a block of code: float ratio = 1.0f / TIME_MOD; TIME_MOD is a static float, declared in a separate file. This value is modified based off of user input in another class (I hav...

How to use more than 3 GB in a process on 32-bit PAE-enabled Linux app?

PAE (Physical Address Extension) was introduced in CPUs back in 1994. This allows a 32-bit processor to access 64 GB of memory instead of 4 GB. Linux kernels offer support for this starting with 2.3.23. Assume I am booting one of these kernels, and want to write an application in C that will access more than 3 GB of memory (why 3 GB? ...

How to avoid PHP memory exhaustion?

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 136753 bytes) in /home/alien/Desktop/1/scanner.php on line 166 this is 166 line of the PHP code: $text[$i] = curl_multi_getcontent ($curl[$i]); is here any way to get around this by emptying RAM or something, sorry I'm not a programmer ...

Degrafa States Memory Management

I was recently profiling my application that uses Degrafa States in the skins and noticed that doing so uses more memory than I expected. Between the SetProperty and State, they were using about 10% of the total used application memory. Would it be better to use css for the state changes and a new skin for each state? or Are there some...

Java large datastructure for storing a matrix

Hi folks, I need to store a 2d matrix containing zip codes and the distance in km between each one of them. My client has an application that calculates the distances which are then stored in an Excel file. Currently, there are 952 places. So the matrix would have 952x952 = 906304 entries. I tried to map this into a HashMap[Integer, Fl...