Display: Cloud | List
Most Popular Tags
Results (4 total) All > powershell (x) > system.gc (x)
GetGeneration Using PowerShell (GC.GetGeneration Method (System))
# get-gcgeneration.ps1# gets GC Generation of an object# Thomas Lee - tfl@psp.co.uk # create an object$foo = ls c:\ # get generation$gen = [system.gc]::getgeneration($foo) # display generation"`$foo is at gc generation: {0}" -f $gen This script produces the following output: PS D:\foo> D:\foo\get-gcgeneration.ps1$foo is at gc generation: 0
Last modified by Thomas Lee on 4/20/2008 9:47:24 AM
GetTotalMemory using PowerShell (GC.GetTotalMemory Method (System))
# get-gcgettotalmemory.ps1# gets total memory used# Thomas Lee - tfl@psp.co.uk # Get Total Memory$total1 = [system.gc]::GetTotalMemory($False)$total2 = [system.gc]::GetTotalMemory($True) # Display results"Memory Used: {0:n}" -f $total1"Memory Used after gc call: {0:n}" -f $total2 This script produces the following output: D:\foo > get-gcgettotalmemory.ps1 Memory Used
Last modified by Thomas Lee on 4/20/2008 9:38:28 AM
CollectionCount Method using PowerShell (GC.CollectionCount Method (System))
# get-gccollectioncount.ps1# gets count of how often gc has been called, by generation# Thomas Lee - tfl@psp.co.uk # Get max generations supported$maxgen = [system.gc]::maxgeneration # Get Collection count per generation and display resultsfor ($i=0; $i -le $maxgen; $i++) {$collectioncount = [system.gc]::collectioncount($i) "Generation {0} - GC called {1} times" -f $i,$collectio
Last modified by norsivad on 2/27/2009 10:00:54 PM
MaxGeneration using PowerShell (GC Properties (System))
# get-maxgeneration.ps1# gets maximum number of GC generations supported using PowerShell# Thomas Lee - tfl@psp.co.uk # Get Max GC Generations$maxgen = [system.gc]::maxgeneration # Display results"Maximum GC generations supported on this system: {0}" -f $maxgen This script produces the following output: PS D:\foo> D:\foo\get-maaxgeneration.ps1Maximum GC generations supported on th
Last modified by Thomas Lee on 4/20/2008 9:11:33 AM
Page view tracker