473,387 Members | 1,465 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,387 software developers and data experts.

how to gat size of objects?

buu
is there any kind of attribute, something like SizeOf in vb.net?

I have many objects, and I would like to get size of them in memory
Aug 8 '07 #1
2 1331
>is there any kind of attribute, something like SizeOf in vb.net?
>
I have many objects, and I would like to get size of them in memory
Not really, no. What do you need the information for?

There's the Marshal.SizeOf method, but it returns the size a type
would take when marshaled to unmanaged memory (if at all possible),
which may be very different from the size an object takes up in
managed memory.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Aug 8 '07 #2
The only way to do this is to load sos.dll debugger into intermediate window
during debugging and see exact sizes of objects.

rgds,
dlm,
www.bypsoft.com
cross-database comparison and synchronisation tools
DBTYP.NET - see differences, for free.

"buu" <ah*@a.comescribió en el mensaje
news:f9*********@enews4.newsguy.com...
is there any kind of attribute, something like SizeOf in vb.net?

I have many objects, and I would like to get size of them in memory


Aug 16 '07 #3

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

Similar topics

2
by: Jéjé | last post by:
Hi everyone. I'm currently implementing a Cache system. Limiting its capacity with the number of object makes no sense, since objects can have any size they want. So I'd like to limit its...
17
by: Sean Ross | last post by:
Hi. Recently I made a small script to do some file transferring (among other things). I wanted to monitor the progress of the file transfer, so I needed to know the size of the files I was...
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
11
by: Walter Dnes (delete the 'z' to get my real address | last post by:
I've noticed a few threads (full of sound and fury, signifying nothing) here recently about allocation of large memory blocks. I'm about to start on a personal pet project where I'll be using...
3
by: MuZZy | last post by:
Hi, Is it ever possible to obtain an object's current size in managed memory? E.g. if i want to know what's the size in bytes occupied by the particular DataSet object right now (of cource...
0
by: Adam Parker | last post by:
I am in the process of writing a simple web server monitor (ASP.Net with VB.Net). One piece of useful information for me to gather would be the amount of memory used by objects stored in the...
5
by: Phil Jones | last post by:
Is there a way to determine the size (number of bytes) of an object? I figure this can be done by serializing the object to disk and measuring the file size - but I definately don't want to do...
11
by: Andy Watson | last post by:
I have an application that scans and processes a bunch of text files. The content I'm pulling out and holding in memory is at least 200MB. I'd love to be able to tell the CPython virtual machine...
5
by: Santiago Romero | last post by:
Is there a way to check the REAL size in memory of a python object? Something like or or something like that ...
30
by: Angel Tsankov | last post by:
Hello! Does the C++ standard define what happens when the size argument of void* operator new(size_t size) cannot represent the total number of bytes to be allocated? For example: struct S {...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.