Gc.hx 314 B

123456789101112131415
  1. package java.vm;
  2. @:native('haxe.java.vm.Gc') class Gc
  3. {
  4. public static function run( major : Bool )
  5. {
  6. java.lang.System.gc();
  7. }
  8. public static function stats() : { heap : Int, free : Int }
  9. {
  10. var r = java.lang.Runtime.getRuntime();
  11. return { heap : cast r.totalMemory(), free : cast r.freeMemory() };
  12. }
  13. }