tags:

views:

23

answers:

2

I'm writing a resource manager, which is required to be fast and has small memory foot-print. For example, I have an resource class

class Abc
{
    string m_name;
    string m_path;
    string handle;
    void SomeFunctions();
}

And so on. Now I create and List< Tuple< int,Abc>> and add 5000 items to it. How much memory will it consume? One more question: Can I find items base on handle number only, which is the int part of the Tuple?

A: 

Try Profiler

rdkleine
+1  A: 

Memory consumption is very difficult to estimate without knowing the average string sizes.

If the integer handle is unique per Abc instance, you should use a Dictionary<int, Abc> instead.

Marcelo Cantos
Thanks. Nice idea!
Quang Anh