There is some articles about How to get object size in memory ? but they does not explain how to get the size of an object in memory.
when I use:
System.Runtime.InteropServices.Marshal.SizeOf(arrayListObject)
i get error:
Type 'System.Collections.ArrayList' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed.
I also can not get the amount of all free memory, becouse i want to perform this calculation on web applications with a lot of threads, so a need to know exactly how much memory needs specific object.