[quickjs-devel] Re: memory leak?

  • From: Fabrice Bellard <fabrice@xxxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Sat, 23 May 2020 11:02:10 +0200

Hi,

Currently QuickJS frees the memory of deleted properties only when the corresponding object is freed. It will be fixed in the next release.

Best regards,

Fabrice.

On 05/14/2020 04:43 AM, Alex Protasenko wrote:

|Hello,
|

|Possible memory leak. When setting and then deleting a property on a persistent object, heap never stops growing.|

|This happens both in a tight loop and when event loop gets to run. Even explicit std.gc() doesn't help much.|

|Only way to stop it is recreate the object from time to time. Is it expected or something can be done about it?|

|Please see below a sample script:
|

|
|

|import * as std from 'std';|

||

|import * as os from 'os';

var obj = {};
function f() {
     for (let i = 0; i < 100000; i++){
         obj.prop = null;
         delete obj.prop;
     }
//    std.gc();
     os.setTimeout(f, 500);
}
f();
|


Thanks

Alex

||


Other related posts: