memory-usage

.NET Max Memory Use 2GB even for x64 Assemblies

I've read (http://blogs.msdn.com/joshwil/archive/2005/08/10/450202.aspx) that the maximum size of an object in .NET is 2 GB. Am I correct in assuming that if I have an Object that takes up 256 MB Memory, since it is a reference type, I can have an array of these 256 MB Objects where all the objects together may takeup >2GB Memory as lon...

.NET Committed vs. Reserved Heap Size

My program has 7,667,712 bytes of committed heap, yet it has 33,546,240 reserved heap bytes! I can see that the program is using around 44 MB of private bytes. How can I get the .NET GC to reserve less space for the managed heap? ...

State Pattern in iPhone applications (Memory Usage)

Does the state pattern in an iPhone application -- In my case, a relatively light-weight utility application -- use too much memory? The state pattern, as I understand it, uses several classes; these classes represent different states. All of the different state objects are instantiated and stored in different pointer variables until t...

Sharing character buffer between C# strings objects

Is this possible? Given that C# uses immutable strings, one could expect that there would be a method along the lines of: var expensive = ReadHugeStringFromAFile(); var cheap = expensive.SharedSubstring(1); If there is no such function, why bother with making strings immutable? Or, alternatively, if strings are already immutable for o...

How can I determine the memory footprint of a session variable?

Also, web.config - please explain. <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="120"/> We are using inproc mode and we used the 20 session variable in our web application. We need to know each variables Occupyin...

Finding the Nth largest value in a group of numbers as they are generated.

I'm writing a program than needs to find the Nth largest value in a group of numbers. These numbers are generated by the program, but I don't have enough memory to store N numbers. Is there a better upper bound than N that can be acheived for storage? The upper bound for the size of the group of numbers (and for N) is approximately 100,0...

How can I programmatically determine my Perl program's memory usage under Windows?

I use ActivePerl under Windows for my Perl script, so I can look at how much memory it uses via the 'Processes' tab in Windows Task Manager. I find having to do this rather cumbersome. Is there another way to determine my Perl program's memory use? ...

Memory-efficient C++ strings (interning, ropes, copy-on-write, etc)

My application is having memory problems, including copying lots of strings about, using the same strings as keys in lots of hashtables, etc. I'm looking for a base class for my strings that makes this very efficient. I'm hoping for: String interning (multiple strings of the same value use the same memory), copy-on-write (I think this...

C#: How to implement a smart cache

I have some places where implementing some sort of cache might be useful. For example in cases of doing resource lookups based on custom strings, finding names of properties using reflection, or to have only one PropertyChangedEventArgs per property name. A simple example of the last one: public static class Cache { private static ...

Reasons for seeing high" % Time in GC" in Perf Mon

While monitoring our application in Perf Mon I noticed that the % of Time In GC is anywhere from 20 - 60% while our application is performing a long running process (varies between 30 seconds to 1.5 minutes). This seems a bit excessive to me. This raises two important questions. Am I correct that this excessive? Routes I can take to ...

Memory performance of Linq to DataSets / Objects with large data sets

Short question: does anyone have any information about what the memory performance of Linq is with large amounts of data? Specifically Linq to Datasets or Linq to Objects. What is the largest number of records / objects it can handle? What is the memory overheads? Can anyone post some ballpark memory usage figures? Background My compa...

c# 'System.OutOfMemoryException' was thrown when there is still plenty of memory free

This is my code: int size = 100000000; double sizeInMegabytes = (size * 8.0) / 1024.0 / 1024.0; //762 mb double[] randomNumbers = new double[size]; Exception: Exception of type 'System.OutOfMemoryException' was thrown. I have 4GB memory on this machine 2.5GB is free when I start this running, there is clearly enough space on the PC t...

Setting background colour of a UIView increasing memory usage

I am loading a number of UIViews onto a UIScrollView and am trying to track down why they are using so much memory. After a process of elimination using Instruments I have discovered that setting the background colour of the views increases memory usage by 4 times. If I don't set the background colour the memory usage sits at around 4....

portable system/process information library

I need to retrieve process information in a C/C++ program. I need at least basic things like CPU% and memory usage, but additional details would be useful as well. The problem is that I need to use this information in a portable program, that will run on multiple platforms: windows, linux, MAC and possibly Solaris too. Is there a libra...

How to profile session memory usage in Java/Seam web application?

Is there any way/tool to profile per-session memory usage in a Java web application? More specifically I'm using Seam and I have a few objects which are specific for the user or for the user's current session so they're set to be stored in the user's session. Some time ago my application would run out of memory when hitting a certain n...

Testing memory usage which tool?

Currently we are using Rational Purify, however it is a pain to use and we have now reached the stage where we are unable to instrument our applications without changing our development build system. The our application is statically linked and large. It is also memory hungry, where peak memory usage is often over 3Gb. Ideally I would ...

How can I get the CPU usage and memory usage of a single process on Linux (Ubuntu)?

I want to get the CPU and memory usage of a single process on Linux - I know the PID. Hopefully, I can get it every second and write it to a CSV using the 'watch' command. What command can I use to get this info from the Linux command-line? ...

aspnet_wp keeps recycling because of high memory consumption. How can I fix it?

Hello, I have a small WCF service which is executed on an XP box with 256 megs of RAM running in VM. When I make a request to that service (request size approx 5mbs) I always get following message in event log: aspnet_wp.exe was recycled because memory consumption exceeded the 153 MB (60 percent of available RAM). and call fails w...

How many Flash objects/movies can you add to a page before memory consumption becomes an issue?

In an Ajax desktop scenario (iGoogle, Netvibes etc); how many separate Flash "widgets" can you load before memory usage becomes a problem? Does each Flash instantiate a separate Flash player? Or is there just one Flash player / browser, so memory usage is only dependant on the memory requirements of the swf? Or is this something that...

Python script knows how much memory it's using

How can a python script know the amount of system memory it's currently using? (assuming a unix-based OS) ...