ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determine memory usage of objects (like Dictionary) (https://www.excelbanter.com/excel-programming/328728-determine-memory-usage-objects-like-dictionary.html)

R Avery[_2_]

Determine memory usage of objects (like Dictionary)
 
I want to write a VBA procedure to determine the size (in RAM) of an
object, e.g., a Scripting.Dictionary. Is there anyway to do this?

If there is no direct way, perhaps it is possible to run some simple
diagnostics like check how much memory VBA has allocated, dim a new
dictionary, check memory allocation again, add 1000 items, check
allocation again... just to get a sense of how much overhead is
involved with the object. Can this be done?

ANy help would be appreciated!


galimi[_2_]

Determine memory usage of objects (like Dictionary)
 
You can use the following properties to determine memory usage before and
after your call to the scripting dictionary

application.memoryfree
application.memorytotal
application.memoryused


--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"R Avery" wrote:

I want to write a VBA procedure to determine the size (in RAM) of an
object, e.g., a Scripting.Dictionary. Is there anyway to do this?

If there is no direct way, perhaps it is possible to run some simple
diagnostics like check how much memory VBA has allocated, dim a new
dictionary, check memory allocation again, add 1000 items, check
allocation again... just to get a sense of how much overhead is
involved with the object. Can this be done?

ANy help would be appreciated!




All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com