memory

Reading from 16-bit hardware registers

On an embedded system we have a setup that allows us to read arbitrary data over a command-line interface for diagnostic purposes. For most data, this works fine, we use memcpy() to copy data at the requested address and send it back across a serial connection. However, for 16-bit hardware registers, memcpy() causes some problems. If I ...

Memory allocation profilers for managed and unmanaged code?

My application runs a combination of C++ (COM objects) and C# managed code. Sadly there is a n elusive memory leak I need to trace down. I've tried AQTime, which looked good on paper, but my app keeps crashing when running underneath it. Any suggestion for a better alternative? Thanks, Boaz ...

Entries in /proc/meminfo

I can make sense of most of the information contained in /proc/meminfo like total memory,buffers, cache etc. Could you tell me what do the less obvious ones like *AnonPages,Mapped,Slab,NFS_Unstable,Bounce,VmallocTotal,VmallocUsed,VmallocChunk* mean? ...

How can I increase the heap size .NET?

Is there something in .NET that corresponds to java -Xmx memory size allocation? ...

Tools and tutorials for examining the gen 2 heap

So you're at that time in your project when looking at Performance monitor, wondering "why is my gen 2 heap so large??" That's where I am, currently. I'm interested in tools and tutorials for examining the contents of the gen 2 heap (and, by extension, gen 1 and 0 and the LOH). ...

Ruby symbols are not garbage collected!? Then, isn't it better to use a String?

If you create 10,000 strings in a loop, a lot of garbage collection has to take place which uses up a lot of resources. If you do the same thing with symbols, you create objects which cannot be garbage collected. Which is worse? ...

What happens when a JSP finishes execution?

Hi, When a JSP finishes execution, will all variables declared in the JSP page be put up for garbage collection? If I declare a number of memory intensive Hashtables in the JSP, and I let the JSP finish execution without setting the variables to null beforehand, will the object stay in memory even after the JSP has finished executing? ...

What are some refactoring methods to reduce size of compiled code?

I have a legacy firmware application that requires new functionality. The size of the application was already near the limited flash capacity of the device and the few new functions and variables pushed it over the edge. Turning on compiler optimization does the trick, but the customer is wary of doing so because they have caused failure...

Memory usage of a kernel module

While trying to estimate the amount of memory consumed by a kernel module (usually device drivers),I tried using the size utility which gave the size of the static memory areas of the .ko ( .bss, .data, .text etc). So I was expecting the sum of these values to be exactly equal to the output given by the lsmod command immediately after in...

Accessing public class memory from C++ using C

Greetings Everyone. I'm currently writing a multi-language programe in C, C++ and fortran on UNIX, unfortunatly I run into "Segmentation Error" when I try and execute after compiling. I've narrowed down the problem to the interface between the C++ and C sections of my program. The first section consists of main.ccp and SA.cpp, and the...

Memory efficiency: One large dictionary or a dictionary of smaller dictionaries?

I'm writing an application in Python (2.6) that requires me to use a dictionary as a data store. I am curious as to whether or not it is more memory efficient to have one large dictionary, or to break that down into many (much) smaller dictionaries, then have an "index" dictionary that contains a reference to all the smaller dictionarie...

What are the most common (and often overlooked) causes of memory leaks in managed (.net) applications?

Hi. Please can anyone recommend a quick checklist / best practice guide to help us avoid simple (but subtle) mistakes that cause could cause memory leaks in .net apps I find it difficult and quite painful to begin searching for the cause of a memory leakage when i'm in the testing phase of a project. If there are 'rules of thumb' to c...

Perl: Programming Efficiency when computing correlation coefficients for a large set of data

EDIT: Link should work now, sorry for the trouble I have a text file that looks like this: Name, Test 1, Test 2, Test 3, Test 4, Test 5 Bob, 86, 83, 86, 80, 23 Alice, 38, 90, 100, 53, 32 Jill, 49, 53, 63, 43, 23. I am writing a program that given this text file, it will generate a Pearson's correlation coefficient table that looks li...

git add error : "fatal : malloc, out of memory"

When i attempt to do a git add i get the error "fatal : malloc, out of memory". i imagine the system has ran out of memory obviously but is there a way to get around this. Also i am running windows server 2003 and using msysGit. EDIT: After more searching around i think its a problem with the packing of git, apparently their compressio...

Seg fault after is item pushed onto STL container

typedef struct temp { int a,b; char *c; temp(){ c = (char*)malloc(10);}; ~temp(){free(c);}; }temp; int main() { temp a; list<temp> l1; l1.push_back(a); l1.clear(); return 0; } giving segmentation fault. ...

Memory management while loading huge XML files

We have an application which imports objects from an XML. The XML is around 15 GB. The application invariably starts running out of memory. We tried to free memory in between operations but this has lead to degrading performance. i.e it takes more time to complete the import operation. The CPU utilization reaches 100% The application is...

Low level programming: How to find data in a memory of another running process?

I am trying to write a statistics tool for a game by extracting values from game's process memory (as there is no other way). The biggest challenge is to find out required addresses that store data I am interested. What makes it even more harder is dynamic memory allocation - I need to find not only addresses that store data but also poi...

Windows event for new added application into memory

Hi. Is there any way to get some Windows event when new application(s) gets added into memory/taskbar? I can get running applications by iterating through Process.GetProcesses() (although, explorer processes will be excluded for some reason), but that means that I have to check for new processes every few seconds which isn't very good. ...

What's the difference between these two classes?

Below, I'm not declaring my_ints as a pointer. I don't know where the memory will be allocated. Please educate me here! #include <iostream> #include <vector> class FieldStorage { private: std::vector<int> my_ints; public: FieldStorage() { my_ints.push_back(1); my_ints.push_back(2); } void displayAl...

How can you find out the maximum size of the memory stack for a C++ program on linux? (gnu compiler)

I am curious about how to find out what the maximum stack size is for a particular compiler/os combo. I am using Ubuntu/GNU compiler. A few questions I have in addition are: Who controls the default maximum stack size; OS or compiler? Is the default maximum scaled according to total memory? (ie a machine with 2gb memory would have larg...