473,666 Members | 2,571 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 1765
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
3307
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 d, and if you say d = Frob(foo=9, bar=23) that creates a Frob instance and stores it in d. Then if...
6
2564
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, I want to store classes of my objects in a vector. I also have three further questions:
100
5238
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
1565
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 crashing. What is the best way to figure out which component is eating up the memory? I have...
2
1622
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 class level; instantiate them when the service starts, and dispose of them when the service ends. Then...
5
1473
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
7204
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
2306
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 again... Sample:foreach (object some in somearray) (some.GetType())some.someaction();
15
3519
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 pointers of the base class type and then allocate each object dynamically with 'new' and store the...
2
3145
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
8454
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8363
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8883
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8787
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8561
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8645
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5672
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.