Legacy:GarbageCollect: Difference between revisions
Jump to navigation
Jump to search
created from http://web.archive.org/web/20110731232702/http://www.spheredev.org/wiki/GarbageCollect |
filled |
||
| Line 1: | Line 1: | ||
[[API:GarbageCollect|GarbageCollect]] invokes SpiderMonkey's garbage collection routine, which will destroy any unused objects, freeing their memory. | |||
GarbageCollect invokes SpiderMonkey's garbage collection routine, which will destroy any unused objects, freeing their memory. | |||
__TOC__ | __TOC__ | ||
==Usage== | ==Usage== | ||
{{Usage | {{Usage|func=GarbageCollect}} | ||
==Notes== | |||
[[API:GarbageCollect|GarbageCollect]] will usually not be needed for most games. You should consider using it if your game creates and destroys a lot of objects in a short space of time and appears to be taking up more memory than it should. In this case, adding a call to [[API:GarbageCollect|GarbageCollect]] may help. | |||
{{API:Script/navbox}} | |||
Latest revision as of 02:32, 2 June 2013
GarbageCollect invokes SpiderMonkey's garbage collection routine, which will destroy any unused objects, freeing their memory.
Usage
GarbageCollect();
Notes
GarbageCollect will usually not be needed for most games. You should consider using it if your game creates and destroys a lot of objects in a short space of time and appears to be taking up more memory than it should. In this case, adding a call to GarbageCollect may help.