memory-usage

Can an XmlSerializer pool strings to avoid large duplicate strings?

I've got some very large XML files which I read using a System.Xml.Serialization.XmlSerializer. It's pretty fast (well, fast enough), but I want it to pool strings, as some long strings occur very many times. The XML looks somewhat like this: <Report> <Row> <Column name="A long column name!">hey</Column> <Column na...

Define smallest possible datatype in c++ that can hold six values

I want to define my own datatype that can hold a single one of six possible values in order to learn more about memory management in c++. In numbers, I want to be able to hold 0 through 5. Binary, It would suffice with three bits (101=5), although some (6 and 7) wont be used. The datatype should also consume as little memory as possible....

Memory usage of a child process?

I'm running a sort of "sandbox" in C on Ubuntu: it takes a program, and runs it safely under the user nobody (and intercepts signals, etc). Also, it assigns memory and time limits, and measures time and memory usage. (In case you're curious, it's for a sort of "online judge" to mark programs on test data) Currently I've adapted the safe...

How to get memory available or used in C#

How can I get the available ram or memory used by the application? ...

Peak memory usage of a linux/unix process

Is there a tool that will run a command-line and report how much RAM was used total? I'm imagining something analogous to /usr/bin/time ...

How to know a thread memory usage?

Hello, is it possible to know how much memory is being used by a given phtread thread? I am interested by a VmRSS like information. ...

How are Process Explorer's memory metrics: WS Private, WS Shareable, WS Shared columns calculated?

I am continuing my saga to understand memory consumption by VB6 application. The option that seems to work best so far is to monitor various memory metrics at key points at run-time and understand where big memory hogs are. The measure driver to study this, is to understand how the application scalability in multi-user environment in Ter...

Iterating over a Binary Tree with O(1) Auxiliary Space

Is it possible to iterate over a binary tree in O(1) auxiliary space (w/o using a stack, queue, etc.), or has this been proven impossible? If it is possible, how can it be done? Edit: The responses I've gotten about this being possible if there are pointers to parent nodes are interesting and I didn't know that this could be done, but...

What's the max. memory available for applications? (getting no more handles error).

In an Eclipse RCP application I am trying to open many editors. It is a basically a tree with lot of nodes each of which opens an editor. When I open in access of 150 to 200 editors and try to open an editor for next treenode it doesn't open. Eclipse console shows "org.eclipse.swt.SWTError: No more handles". However if I close a few of a...

Whats the maximum memory that a Flash movie can use in a browser?

I need to store a lot of data coming in from a server into memory, so I have to write my memory-storage algorithms based on how much I can safely use without hanging up or crashing the browser. Is there any safe size limit like 1MB or 100MB, that contents of global variables should not exceed? ...

Allowed memory size of * bytes exhausted, in php

I'm getting the 'out of memory' error in php. I know it can be fixed with the likes of ini_set("memory_limit","64M"), but I don't want to, because that much memory for a script is abnormal. I have a few reports that are so huge that I pretty much need that memory, but normally don't. The problem is: I don't even know which script is con...

Memory usage of FileChannel#map

Does FileChannel#map allocate all the memory needed for the resulting ByteBuffer immediately, or is it only allocated on-demand during reads from the buffer? I just tried mapping all of a 500+ MB file in a trivial test program, and looked at the memory usage of the process. (Using both Runtime#totalMemory and eyeballing it in the OS X A...

An impasse with hooking calls to HeapAlloc for a memory tracking application.

I am writing a memory tracking application that hooks all the calls to HeapAlloc using IAT patching mechanism. The idea is to capture all the calls to HeapAlloc and get a callstack. However I am currently facing a problem with getting the callstack using DBGHELP Apis. I found that the dbghelp dll itself is linking to MSVCRT dll and thi...

track C++ memory allocations

I am looking for a way to track memory allocations in a C++ program. I am not interested in memory leaks, which seem to be what most tools are trying to find, but rather creating a memory usage profile for the application. Ideal output would be either a big list of function names plus number of maximum allocated bytes over time or better...

SQL connection lifetime

I am working on an API to query a database server (Oracle in my case) to retrieve massive amount of data. (This is actually a layer on top of JDBC.) The API I created tries to limit as much as possible the loading of every queried information into memory. I mean that I prefer to iterate over the result set and process the returned row o...

How can I get CPU usage and/or RAM usage of a *THREAD* in C# (managed code)?

I know how to get CPU usage and memory usage for a process, but I was wondering how to get it on a per-thread level. If the best solution is to do some P-Invoking, then that's fine too. Example of what I need: Thread myThread = Thread.CurrentThread; // some time later in some other function... Console.WriteLine(GetThreadSpecificCpuUs...

Python total memory used

Is there a way for a Python program to determine how much memory it's currently using? I've seen discussions about memory usage for a single object, but what I need is total memory usage for the process, so that I can determine when it's necessary to start discarding cached data. ...

How much memory was actually allocated from heap for an object?

I have a program that uses way too much memory for allocating numerous small objects on heap. So I would like to investigate into ways to optimize it. The program is compiled with Visual C++ 7. Is there a way to determine how much memory is actually allocated for a given object? I mean when I call new the heap allocates not less than th...

How to get a specific memory address using C

For my bachelor thesis i want to visualize the data remanence of memory and how it persists after rebooting a system. I had the simple idea to mmap a picture to memory, shut down my computer, wait x seconds, boot the computer and see if the picture is still there. int mmap_lena(void) { FILE *fd = NULL; size_t lena_size; vo...

Why does loading more than a megabyte of images consume all of my iPhone's memory?

I'm writing an application that needs to hold around forty 44 kb JPEGs in memory at once. I've heard that applications can use around 22 megabytes before triggering a low memory warning, so I'm pretty sure it should be able to do this. However, once I pass around a megabyte loaded, these messages start popping up in the console: Mon Ju...