This shows you the differences between two versions of the page.
| — |
faq:technical:how_do_i_run_the_garbage_collector_in_a_macro_or_plugin [2019/04/12 13:13] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== FAQ: How do I run the garbage collector in a macro or plugin? ====== | ||
| + | |||
| + | **If a macro or plugin runs out of memory, you can force garbage collection.** | ||
| + | |||
| + | The Java Virtual Machine does garbage collection automatically as necessary, but this can also be forced at a particular time in a plugin or a macro. | ||
| + | |||
| + | In a //macro// use the **call()** function (needs version 1.37e): | ||
| + | |||
| + | call("java.lang.System.gc"); | ||
| + | |||
| + | In a //plugin// use the call: | ||
| + | |||
| + | System.gc(); | ||