473,516 Members | 3,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to find which objects use most of the memory

Hello.

Is there any tool which could help finding out which objects consume
most of the memory?

I was thinking something which would generate a report like:
ClassA 120003 instances 3MB
ClassB 4550 instances 1MB
and so on.

I used massif of valgrind but it doesn't do what I need.

Thanks for your reply

Sep 21 '07 #1
3 1753
anakreon wrote:
Hello.

Is there any tool which could help finding out which objects consume
most of the memory?

I was thinking something which would generate a report like:
ClassA 120003 instances 3MB
ClassB 4550 instances 1MB
and so on.

I used massif of valgrind but it doesn't do what I need.

Thanks for your reply
Tools: No idea.

If you asking about the class size, then use sizeof operator, count your
object. Sccot Meyers has article on this issue, check out his homepage
If you meant there are pointers inside of classes, and you want to add
the size of what the pointer points not add the size of an pointer, it's
more complicated, not only the pointer issue, but also some recursive
calculation; as an clue, you have to apply some extra mechanism shipped
with you platform, like VC, we can use _CheckMemState. But I think it's
hard.

--
Thanks
Barry
Sep 21 '07 #2
On 2007-09-21 16:17, anakreon wrote:
Hello.

Is there any tool which could help finding out which objects consume
most of the memory?

I was thinking something which would generate a report like:
ClassA 120003 instances 3MB
ClassB 4550 instances 1MB
and so on.

I used massif of valgrind but it doesn't do what I need.
You can probably get information like that from a better profiler, using
the right settings.

--
Erik Wikström
Sep 21 '07 #3
On Sep 21, 6:20 pm, Erik Wikström <Erik-wikst...@telia.comwrote:
On 2007-09-21 16:17, anakreon wrote:
Hello.
Is there any tool which could help finding out which objects consume
most of the memory?
I was thinking something which would generate a report like:
ClassA 120003 instances 3MB
ClassB 4550 instances 1MB
and so on.
I used massif of valgrind but it doesn't do what I need.

You can probably get information like that from a better profiler, using
the right settings.

--
Erik Wikström
Which profiler would you suggest?

Sep 21 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
3288
by: Paul Rubin | last post by:
I've had this recurring half-baked desire for long enough that I thought I'd post about it, even though I don't have any concrete proposals and the whole idea is fraught with hazards. Basically I wish there was a way to have persistent in-memory objects in a Python app, maybe a multi-process one. So you could have a persistent dictionary...
6
2552
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a "SEGV" when run (presumably - attempt to delete deleted memory. Please take a look and see if you can notice any mistakes I'm making. Basically,...
100
5161
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
1
1556
by: Tosch | last post by:
I have an application that uses to COM objects and does a complex file conversion between two different systems. When converting a large amout of files I'm experiencing a memory leak resulting in my application eating hundreds of MBs of memory and not releasing it. This again results in a system being very unstable and my application finally...
2
1612
by: Fish | last post by:
I have been researching the correct way to organize my solution so that it makes best use of VB.NET inherent ability to manage resources such as objects. My solution contains 2 projects and the main problem is that the mem usage continues to grow until the Service stops responding. I have received advice to: "create those objects at a...
5
1464
by: NewToCPP | last post by:
There are several occations where we write onto someone else' memory region. Is there any debugging mechanism to find out which part of the code is causing this problem?
18
7167
by: ma740988 | last post by:
Trying to get more acclimated with the use of function objects. As part of my test, consider: # include <vector> # include <iostream> # include <algorithm> #include <stdexcept> #include <bitset> using std::vector;
5
2287
by: SunnyDrake | last post by:
HI! I wrting some program part of it is XML config parser which contains some commands(for flexibility of engenie). how do i more simple(if it possible not via System.Reflection or System.CodeDom.CodeCastExpression) __problem typecast #1 Desc:i do needed checks but data/commands in XML is dynamic and i don't wanna fix C# code again and...
15
3503
by: Juha Nieminen | last post by:
I'm sure this is not a new idea, but I have never heard about it before. I'm wondering if this could work: Assume that you have a common base class and a bunch of classes derived from it, and you want to make a deque which can contain any objects of any of those types. Normally what you would have to do is to make a deque or vector of...
2
3135
by: Rares Vernica | last post by:
Hello, How does find works for a map where the key is float? I know you cannot just simply compare floats for equality, you need to use fabs and some epsilon. I know map does not use equality, but uses "less". Still two floats (float a,b;) might show as a b when in fact they are equal. I am a bit confused.
0
7273
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7547
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5712
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3265
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1620
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.