2

Can I control the memory limit (i.e. when GC has to run) in my Flex application?

Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203

3 Answers3

3

Check out the flash.system.System class. The "totalMemory" property will show you (in bytes) how much memory the current application is using. Calling System.gc() will run a GC. You could use a Timer to periodically check totalMemory and then preform gc if it exceeds a threshold. More info:

http://livedocs.adobe.com/flex/3/langref/flash/system/System.html

cliff.meyers
  • 17,666
  • 5
  • 51
  • 66
2

I am not 100% sure, but I believe the answer is no. Read this article.

Marvin
  • 229
  • 1
  • 3
  • 11
Simon
  • 78,655
  • 25
  • 88
  • 118
0

I don't think so. That is probably a parameter of the flash player based at the client, and I assume it is also dependant on the exact resources the client machine has, i.e. more RAM means less frequent gc, etc.

David Hanak
  • 10,754
  • 3
  • 31
  • 39