memory

C++ Memory management

I've learned in College that you always have to free your unused Objects but not how you actually do it. For example structuring your code right and so on. Are there any general rules on how to handle pointers in C++? I'm currently not allowed to use boost. I have to stick to pure c++ because the framework I'm using forbids any use of...

Process Memory Size - Different Counters

I'm trying to find out how much memory my own .Net server process is using (for monitoring and logging purposes). I'm using: Process.GetCurrentProcess().PrivateMemorySize64 However, the Process object has several different properties that let me read the memory space used: Paged, NonPaged, PagedSystem, NonPagedSystem, Private, Virtua...

.Net 2.0 - How efficient are Generic Lists?

I'm creating an app that holds loads of loads of user data in memory, and it's mostly keeping it all in List<T> structures (and some Dictionary<T,T> when I need lookup). And I'm wondering... How efficient are Lists? How much memory overhead do I get for each of them? (that is, memory space in addition to what the objects they contain w...

What's the maximum amount of RAM I can use in a Windows box?

Obviously, that's 64-bit windows. Also, what's the maximum amount of memory a single 64-bit process can use? I was kind of counting on using it all... (Yes, I know what I'm doing, please don't tell me that if I need that much RAM i must be doing something wrong) Also, is this the same for a .Net 2.0 process? Or is there a lower limit ...

CLR Profiler - Attaching to existing process

I would like to use something like CLR Profiles on .Net 2.0 to see what objects are taking more space in the heap at any given time (of an ASP.Net worker process). However, the CLR Profiler only lets me START an app, not attach to an existing one. I assume this is because it tracks allocations and GC too, but i'm not very interested in ...

64bit Memory allocation

I've been asked to create a Delphi compatible dll in C++ to do simple 64bit memory management. The background is that the system in Delphi needs to allocate a lots of chunks of memory that would go well outside 32bit addressable space. The Delphi developer explained to me that he could not allocate memory with the Delphi commands availa...

(C) How do I determine the size of my array?

i.e., the number of elements the array can hold? ...

How to find a Java Memory Leak

How do you find a memory leak in Java (using for example JHat)? I have tried to load the heap dump up in JHat to take a basic look. However I do not understand how I am supposed to be able to find the root reference (ref) or whatever it is called. Basically I can tell that there are several hundred meg of hash table entries ([java.util.H...

Store more than 3GB of video-frames in memory, on 32-bit OS

At work we have an application to play 2K (2048*1556px) OpenEXR film sequences. It works well.. apart from when sequences that are over 3GB (quite common), then it has to unload old frames from memory, despite the fact all machines have 8-16GB of memory (which is addressable via the linux BIGMEM stuff). The frames have to he cached into...

Does Google Chrome's process-per-tab model inherently use more memory than Firefox and IE?

Does the process-per-tab model that Chrome uses end up using more memory than Firefox and IE? Does it really matter? Sure, memory is cheap, but the cost of adding more memory is not insignificant. ...

How to monitor the computer's cpu, memory, and disk usage in Java?

I would like to monitor the following system information in Java: current cpu usage** (percent) available memory* (free/total) available disk space (free/total) *note that I mean overall memory available to the whole system, not just the JVM I'm looking for a cross-platform solution (Linux, Mac, Windows) that doesn't rely on my own ...

What is a jump table?

Can someone explain the mechanics of a jump table and why is would be needed in embedded systems? ...

View of allocated memory

I'm looking for a tool ($, free, open source; I don't care) that will allow me to view not just the memory statistics for a .NET program, but also the object hierarchy. I'd really like to be able to drill down each thourgh each object and view it's foot print, as well as all the object's it references. I've looked at things like Ants Pr...

Is it possible to track allocation/deallocation in C#?

As far as I can tell, this is isn't possible, so I'm really just hoping for a left field undocumented allocation hook function. I want a way to track allocations like in _CrtSetAllocHook, but for C#/.net. The only visibility to the garbage collector/allocation appears to be GC.CollectionCount. Anyone have any other .net memory mojo? ...

How to log mallocs

This is a bit hypothetical and grossly simplified but... Assume a program that will be calling functions written by third parties. These parties can be assumed to be non-hostile but can't be assumed to be "competent". Each function will take some arguments, have side effects and return a value. They have no state while they are not runn...

Ubuntu 32 bit maximum address space

Jeff covered this a while back on his blog in terms of 32 bit Vista. Does the same 32 bit 4 GB memory cap that applies in 32 bit Vista apply to 32 bit Ubuntu? Are there any 32 bit operating systems that have creatively solved this problem? ...

Determine how much memory a class uses?

I am trying to find a way to determine at run-time how much memory a given class is using in .NET. Using Marshal.SizeOf() is out, as it only works on value types. Is there a way to check exactly how much memory a class uses? ...

Is there a need to destroy char * = "string" or char * = new char[6]

I assume when I do char* = "string" its the same thing as char* = new char[6]. I believe these strings are created on the heap instead of the stack. So do I need to destroy them or free their memory when I'm done using them or do they get destroyed by themselves. ...

In Java, what is the best way to determine the size of an object?

For example, let's say I have an application that can read in a CSV file with piles of data rows. I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause OutOfMemory Exceptions. Each row translates into an object. Is there an easy way to find ...

Memory leak detectors for C?

What memory leak detectors have people had a good experience with? Here is a summary of the answers so far: Valgrind - Instrumentation framework for building dynamic analysis tools. Electric Fence - A tool that works with GDB Splint - Annotation-Assisted Lightweight Static Checking Glow Code - This is a complete real-time performanc...