memory

Console output retained in char[] causes OutOfMemoryError

I've got an applet that keeps running out of memory. A heap dump analysis shows that the culprit is a char[] owned by the traceMsgQueueThread that contains the entire contents of the java console output. This grows over time as log messages are sent to the console until eventually the applet runs out of memory. This only seems to occu...

How much memory is my windows app really using?

I have a long-running memory hog of an experimental program, and I'd like to know it's actual memory footprint. The Task Manager says (in windows7-64) that the app is consuming 800 mb of memory, but the total amount of memory allocated, also according to the task manager, is 3.7gb. The sum of all the allocated memory does not equal 3.7...

.NET Secure Memory Structures

I know the .NET library offers a way of storing a string in a protected/secure manner = SecureString. My question is, if I would like to store a byte array, what would be the best, most secure container to hold this? ...

Issue with flash room editor and large number of images loaded in

I created a Flash room editor for an online game. The user is able to add items to their room, which the flash loads in and creates an object for each item. For the average user this works great, but I have run across a case where a user has added 8400 items to a room and the flash can't handle it. The XML file loads up fine, but noth...

Writing to Shadow Memory?

I want to write F000:0000 ~ FFFF:0000 in real mode (DOS). But this area is write-protected. I tried to find datasheet of CPU and Northbridge. But, i can't find write method of shadow ram. My system configuraion: M/B: ASUS P5B(965P Chipset) CPU: Intel Pentium 4 Series BIOS: AMI ...

Linux mmap() error

I have a memory mapped file, from which I wish to parse the contents of the buffer. The mmap() returns success, and I can print out the buffer contents to a file using fprintf successfully. However, when I try to access the buffer as an array in my program directly, I get a segmentation fault. Why is this happening? Here is the code: ...

C# .NET Linq Memory Cleanup or Leak?

I have a large 2GB file with 1.5 million listings to process. I am running a console app that performs some string manipulation then uploads each listing to the database. I created a LINQ object and clear the object by assigning it to a new LinqObject() for each listing (loop). When the object is complete, I add it to a list. Whe...

Segmentation fault during Transition of Control from C++ to Pro *C

Hi, I have written a small Pro *C/C++ application [ multi-threaded, daemon ] where, i used Pro *c to fetch some DB records and then call C++ function to generate XML files, which are sent through socket to third party. The problem is that, when the c++ function is called, it is generating the xml file properly, but ending up with Sig 1...

Shared libraries memory space

Does a c++ shared library have its own memory space? or does it share the caller process' one? I have a shared library which contains some classes and wrapper functions. one of this wrapper function is kinda: libXXX_construct() which initializes an object and returns the pointer to the said object. Once I use libXXX_construct() in a c...

MySQL maximum memory usage

Hi, I would like to know how it is possible to set an upper limit on the amount of memory MySQL uses on a Linux server. Right now, MySQL will keep taking up memory with every new query requested so that it eventually runs out of memory. Is there a way to place a limit so that no more than that amount is used by MySQL? Thanks in advance...

Reading part of a file in C using fread() and fseek()

I'm trying to read a file into a buffer in blocks of size BLOCK_SIZE (currently equal to 1000 unsigned chars). My code first finds the number of blocks it will have to read in order to read the entire file (usually 2-4), then iterates through a for loop reading the file (ignore the "+17+filenamesize" stuff, that is all needed for later i...

What increases an object's retain count?

Here is code I am referring to. // Person.h @interface Person : NSObject { NSString *firstName; NSString *lastName; } @end // Person.m @implementation Person - (id)init { if (![super init]) return nil; firstName = @"John"; lastName = @"Doe"; } @end // MyClass.m @implementation MyClass ..... - (NSArray *)getP...

Tracing memory corruption on a production linux server

Guys, could you please recommend a tool for spotting a memory corruption on a production multithreaded server built with c++ and working under linux x86_64? I'm currently facing the following problem : every several hours my server crashes with a segfault and the core dump shows that error happens in malloc/calloc which is definitely a s...

Can I programmatically view the managed heap contents from a .NET application?

Is it possible to access the managed heap in a .NET application and e.g. enumerate the objects that are currently allocated there? I know there are various tools out there that allow you to do that, but I would rather do this myself from code so that I can use it in automated tests, like for checking if everything is disposed and cleane...

Memory Allocation Crash

I have stumbled accross a strange problem in which I cannot understand. I am not an expert at C/C++ so bear with me. I have an NPC class, which derives from a Player class, which derives from a Sprite class. The sprite class contains a setupAnimation function, which allocates an array of floats containing coordinates on the texture, each...

Manipulate an Archive in memory with PHP (without creating a temporary file on disk)

Hi, I am trying to generate an archive on-the-fly in PHP and send it to the user immediately (without saving it). I figured that there would be no need to create a file on disk as the data I'm sending isn't persistent anyway, however, upon searching the web, I couldn't find out how. I also don't care about the file format. So, the ques...

What happens when you run out of ram with mlockall set?

I am working on a C++ application that requires a large amounts of memory for a batch run. (> 20gb) Some of my customers are running into memory limits where sometimes the OS starts swapping and the total run time doubles or worse. I have read that I can use the mlockall to keep the process from being swapped out. What would happen whe...

What memory types does Tomcat use and how can it be controlled

Hi, I know there are several memory types that Tomcat uses when running. The only I have ever used - java heap. It can be controlled through JAVA_OPTS env property with something like '-Xmx128M -Xms64M' I have found that there is also -XX:MaxPermSize, -XX:MaxNewSize and etc. The reason I'm asking is that I'm trying to launch Tomcat5....

Behaviour of static variables in dynamically linked libraries (C/C++)

As discussed here, a static variable is stored in the .BSS or .DATA segment. Where is this memory stored if the static variable is inside a function that's in a dynamically linked library ? Does storage for this variable get allocated in the .BSS or .DATA segment of the linking process at the time of linkage ? ...

What are good environments for running high-memory-consuming (Python/Perl) scripts?

I'm looking for suggestions on new development system from some programmers that have more experience, but let me give some background on why. We need a new development server for running scripts on large feeds Speed is not a concern, it just needs to finish The scripts are not ran often, and are typically coded very quickly (not o...