PageRenderTime 6ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Memory.as

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
ActionScript | 28 lines | 17 code | 1 blank | 10 comment | 0 complexity | a83b600438e19b8c007c2d1d0ede8f1e MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  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. }