Dear Mattias,
Thanks for replying to my mail...I guess I am trying to dig a well
in a desert to find water....just one more query...I tried the
following...
<System.Runtime.InteropServices.DllImport("kernel3 2.dll")> _
Public Shared Function GlobalSize(ByVal hMem As Long) As Long
End Function
Dim FrameString As String = "Hello World"
Dim oHandle As GCHandle = GCHandle.Alloc(FrameString)
Dim oPtr As IntPtr = New IntPtr(4)
oPtr = GCHandle.op_Explicit(oHandle)
Dim oLong As Long = CType(oPtr.ToInt32, Long)
Dim oSize As Long = GlobalSize(oLong)
But every time I got the same value in oSize.
5636130963718144
5636130963718144
Is this method wrong too...
Please help...
TALIA
Many Regards
Sunil
Mattias Sjögren <ma********************@mvps.org> wrote in message news:<uS**************@TK2MSFTNGP12.phx.gbl>...
Sunil,
Given a Hash Table containing "n" objects (each having many
properties) - is it possible to know how much memory that hash table
has taken - in a simple console application?
No, not from within your code.
http://blogs.gotdotnet.com/cbrumme/p...b-d567996e6fc9
Is this the right method? Is there some other simple method?
That gives you the size of the objects when serialized, which isn't
necessarily the same as the in-memory size.
Mattias