The comment claimed that the memory usage of a reused QuickJS
runtime could only remain high if the global scope was modified.
Values retained by engine internals and uncollected garbage are also
counted, while memory outside of the runtime is not.
/*
* After the request object is freed, the runtime's memory usage should
- * be low. It can only remain high if the global scope was
- * modified.
+ * be low. It can remain high if values were retained, for example in
+ * the global scope, or if garbage was not yet collected.
*
* To prevent unlimited memory consumption growth, check whether memory
* usage exceeds the configured limit. The check is performed rarely to
* avoid performance impact of JS_ComputeMemoryUsage() which is slow.
+ * Memory outside of the runtime, such as nginx pools, is not counted.
*/
if ((ngx_random() & 0xff) == 1) {