2011-07-29 31 views

回答

2

你嘗試使用GC本身?

 long trackStart = System.GC.GetTotalMemory(true); 

     //your code goes here 
     byte[] testData = new byte[50000]; 

     long trackEnd = System.GC.GetTotalMemory(true); 

     long diff = trackEnd - trackStart; //You get bytes used.. may not be exact size 
相關問題