/flash-src/third-party/com/hurlant/util/Memory.as

http://github.com/gimite/web-socket-js · ActionScript · 28 lines · 17 code · 1 blank · 10 comment · 0 complexity · b1585d2de7202af0af367bb9cabd80b6 MD5 · raw file

  1. /**
  2. * Memory
  3. *
  4. * A class with a few memory-management methods, as much as
  5. * such a thing exists in a Flash player.
  6. * Copyright (c) 2007 Henri Torgemane
  7. *
  8. * See LICENSE.txt for full license information.
  9. */
  10. package com.hurlant.util
  11. {
  12. import flash.net.LocalConnection;
  13. import flash.system.System;
  14. public class Memory
  15. {
  16. public static function gc():void {
  17. // force a GC
  18. try {
  19. new LocalConnection().connect('foo');
  20. new LocalConnection().connect('foo');
  21. } catch (e:*) {}
  22. }
  23. public static function get used():uint {
  24. return System.totalMemory;
  25. }
  26. }
  27. }