Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Memory usage of Managed Objects

Reply
Thread Tools

Memory usage of Managed Objects

 
 
Adam Parker
Guest
Posts: n/a
 
      01-18-2005
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 cache, since objects are
thrown in there left and right.

Items in the cache are either custom objects or are Hashtables. How can I
get the memory size of these objects.

Marshal.SizeOf(object) does not work in this case because .Net cannot
Marshal Managed objects. I thought that I might be able to pull out the
component items in each object and build the total size from their aggregate
sizes, however that would require me to determine each objects type so that I
can correctly gather size info from the internal attributes, something that I
do not want to do.

Is there a generic way to either:
1) get the size of Managed Objects
2) convert Managed Objects into Unmanaged Objects that can be marshaled?
OR
3) some other way to get memory sizes of cached objects

I appreciate the help.
 
Reply With Quote
 
 
 
 
thorpe
Guest
Posts: n/a
 
      01-18-2005
this is an asp group. i suggest maybe looking for a group with .net in the
name.

"Adam Parker" <> wrote in message
news:C9A243AA-125D-46C7-8274-...
>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 cache, since objects are
> thrown in there left and right.
>
> Items in the cache are either custom objects or are Hashtables. How can I
> get the memory size of these objects.
>
> Marshal.SizeOf(object) does not work in this case because .Net cannot
> Marshal Managed objects. I thought that I might be able to pull out the
> component items in each object and build the total size from their
> aggregate
> sizes, however that would require me to determine each objects type so
> that I
> can correctly gather size info from the internal attributes, something
> that I
> do not want to do.
>
> Is there a generic way to either:
> 1) get the size of Managed Objects
> 2) convert Managed Objects into Unmanaged Objects that can be marshaled?
> OR
> 3) some other way to get memory sizes of cached objects
>
> I appreciate the help.



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-18-2005
thorpe wrote:
> this is an asp group. i suggest maybe looking for a group with .net
> in the name.
>

Actually, the name needs to contain "dotnet".
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between Memory Usage and Heap Usage in my JVMMetrics ? Krist Java 8 02-10-2010 12:44 AM
retrieving CPU Usage and Memory Usage information in JAVA hvt Java 0 03-13-2007 01:09 PM
retrieving CPU Usage and Memory Usage information in JAVA hvt Java 0 03-13-2007 01:07 PM
public keyword usage in managed c++ CeZaR C++ 7 08-20-2004 04:05 PM
Need help on memory usage VS PF usage metfan Java 2 10-21-2003 01:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57