473,420 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,420 software developers and data experts.

How to measure the size of an object.

I am doing some memory profiling work and I am trying to figure out the
minimum size of an object. The object has a bunch of variables that are
other objects (hashtables, array lists, and whatnot).

How can I measure the size of such an object? C# provides a sizeof
operator, but only for value types.

Regards,
Robert
Nov 17 '05 #1
1 5941
Robert,

You can't really do this through managed code. If you wanted to do
this, you would have to hook into the CLR using the debugging interfaces (a
bunch of COM work), and do it from there. The CLR doesn't expose this
information to managed code.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Frank Rizzo" <no**@none.com> wrote in message
news:uE**************@tk2msftngp13.phx.gbl...
I am doing some memory profiling work and I am trying to figure out the
minimum size of an object. The object has a bunch of variables that are
other objects (hashtables, array lists, and whatnot).

How can I measure the size of such an object? C# provides a sizeof
operator, but only for value types.

Regards,
Robert

Nov 17 '05 #2

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

Similar topics

1
by: Anand Ganesh | last post by:
Hi All, I have an image which is made to fit in a Window. The user can Zoom In or Zoom Out and Pan the image. These images are Engineering drawings which has been drawn to scale say 1 inch =...
2
by: AlirezaH | last post by:
How to measure hard disk capacity?
2
by: Tom L | last post by:
How can I tell how much memory is being user for each user session?
5
by: Joe Fallon | last post by:
Is there a good way to measure the size of a page delivered to the browser? Also, how do measure the size of Viewstate? I am just using View Source, saving the text file and looking at the number...
6
by: Scirious | last post by:
People, how can I know how big an object is? I mean, I have an object the collects data from a stream and when it grows to an especific size I need to create a new object to continue collecting the...
3
by: Neagu, Adrian | last post by:
Hello everybody, I try to solve the following problem: I have a python program that takes a lot of memory (>hundred Mb). I made an improvement (I hope) and I want to measure the gain (if...
14
by: asit dhal | last post by:
Can anyone tell how to measure the size of an array without use of sizeof operator ?
4
by: Academia | last post by:
I need to create a Bitmap just big enough to display a string. Since I need a Graphic object to measure the string I create and dispose a Bitmap and a Graphic object only for that purpose. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.