|
-
Aug 19th, 2003, 07:29 AM
#1
Thread Starter
Fanatic Member
Code to get memory used
Anyone know code to get the currently used memory. I want to get the total memory used in a function, so I thought I would get the memory before the function executes, and then subtract this from the memory after the function is complete.
Thanks!
-
Aug 19th, 2003, 09:01 AM
#2
Frenzied Member
As the GC wont release the resources immediately after you are done with them, the memory usage after your function is complete may not be accurate.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Aug 19th, 2003, 09:06 AM
#3
Thread Starter
Fanatic Member
I guess the best way would be through the task manager - and see what the peak memory usage is during execution of the function.
-
Aug 19th, 2003, 09:36 AM
#4
Frenzied Member
These properties of the Process class will help you but the results wont be what you need because of the GC.
PagedMemorySize
PagedSystemMemorySize
PeakPagedMemorySize
PeakVirtualMemorySize
PeakWorkingSet
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|