Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 21st, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. GC.GetTotalMemory use and its return value
  2. long mem1=GC.GetTotalMemory(false);
  3. Object[] array= new Object[1000000];
  4. array[1]=obj; // obj is the object content of the file before it is saved on disk
  5. long mem2=GC.GetTotalMemory(false);
  6. long sizeOfOneElementInArray=(mem2-mem1)/1000000;
  7.        
  8. Object[] o = new Object[1000000];
  9.        
  10. o[1] = obj;