High memory usage

Hi
I have a big application that did write with VC++.
My application is using more than 1.5 GB memory but i don't know what part of my code is wrong or what container/variable is using more memory!
Is there anyway or tools that i found the problem origin?
I tried "ATI CodeAnalyst","GlowCode" before but no one of them give me the problem origin.

Note: I haven't any memory leak,I have only high usage, for example in one of my classes such as MyObject i can define a "std::string mFileName" member that keep filename of object or a "short int mFileID" that keep id of filename. The second is better and use less memory. Its just a short example. In my code i have std::map<std::string,std::set<std::string>> and more complex container. i want know what object is using larger size of memory.

Thank you for any help.
H.Ahmadi
Last edited on
I did forget to mention that i have no memory leak in my project. Sorry, please read my note that now is added in the first post.
I have only high consuming variable, members or containers, But i need a tools or way to found them.
Last edited on
My application is using more than 1.5 GB
How do you know it's using 1.5GB of memory? What metric has given you that value? There are lots of subtly but distinctly different memory metrics on Windows.
How do you know it's using 1.5GB of memory?

Windows task manager show me that my process is using 1,574,540 KB memory (Private Working Set) .
I don't think its very hard that you see memory usage of a process.
But probability you mean that maybe i have memory leak and i think that my process is using 1,574,540 KB of memory ! but i must say that i checked my program fully with VLD(Visual Leak Detector) and other tools, no memory leak exists in my project.
And also my application initialization take this huge memory!

What metric has given you that value?

I'm using overload version of "New" Operator and sum of my memory allocation in bytes is more than 1.5 GB, Because of huge code, i can not understand which part of my application is using the system RAM un-normally.
I need a tools that for example say:
Your application have :
100,000 x TObject =200mb
1xstd::map<string,string>=400mb that contain 100,000 data.
...

Thank you for any help.
H.Ahmadi

valgrind gives you a full report on all location/callstack combinations that have allocated memory, sorted by total allocation size (run with --leak-check=full --show-reachable=yes).
It's not available for Windows, so you'll need to boot up a VM to run it.
You really should be checking private bytes.

I don't think its very hard that you see memory usage of a process.
So you may think, but it's tricky to work out what's going on. The working set is not really relevant in this case.

But probability you mean that maybe i have memory leak
You keep saying you don't have a leak.

Run up Performance Monitor and graph the private bytes over time. When the app reaches this peak, you can stop the trace. If I can see the graph I can help, but I can't comment further on what you've posted.
Topic archived. No new replies allowed.