OLD | NEW |
1 function gc() | 1 function gc() |
2 { | 2 { |
3 if (window.GCController) | 3 if (window.GCController) |
4 return GCController.collect(); | 4 return GCController.collectAll(); |
5 | 5 |
6 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) | 6 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) |
7 var s = new String(""); | 7 var s = new String(""); |
8 } | 8 } |
9 } | 9 } |
10 | 10 |
11 function removeScriptElement() { | 11 function removeScriptElement() { |
12 var s = document.getElementById('theScript'); | 12 var s = document.getElementById('theScript'); |
13 s.parentNode.removeChild(s); | 13 s.parentNode.removeChild(s); |
14 } | 14 } |
15 | 15 |
16 removeScriptElement(); | 16 removeScriptElement(); |
17 gc(); | 17 gc(); |
OLD | NEW |