Sounds like a great time for weak references. This lets the GC dictate the size of the cache based on memory pressure.
Jim -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED]]On Behalf Of Ben Kloosterman Sent: Monday, June 03, 2002 9:00 PM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Size of object Does anybody know how to get the size of an object and its referenced object in memory ? Marschal .SizeOf does not seem to do what I want. For reference I have a cache of DataTables in memory on the client if it grows to big I want to trim some according to a Last Used polic. Ben Kloosterman You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.