Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference leak #127

Open
hjiayz opened this issue May 30, 2023 · 5 comments
Open

reference leak #127

hjiayz opened this issue May 30, 2023 · 5 comments

Comments

@hjiayz
Copy link

hjiayz commented May 30, 2023

flutter: reference leak:
    ADDR	REF	TYPE	PROP
  12721561	1	_JSFunction	(key, val) => { this[key] = val; } ...
  403143782	1	_JSFunction	function XMLHttpRequest() { ...
  260057805	1	_JSFunction	function FLUTTER_NATIVEJS_MakeQuerablePromise(promise) { ...
#0      new JSError
object.dart:92
#1      QuickJsRuntime2.close
quickjs_runtime2.dart:137
#2      QuickJsRuntime2.dispose
quickjs_runtime2.dart:211

flutter_js: ^0.7.0

@iulian0512
Copy link

still ocurring in 0.8.0

@iulian0512
Copy link

@abner so far during usage i have not found any issues because of this, based on your experience can you tell if this is concerning or we can treat it as a let's say a warning ?

@moshstudio
Copy link

I'm also facing a memory leak problem, but i have no idea why's it 😂

@liruohrh
Copy link

liruohrh commented Jul 11, 2024

version: 0.8.1
has not free JsRef.

  1. for (key, val) => { this[key] = val; },in quickjs/quickjs_runtime2.dart,QuickJsRuntime2#initChannelFunctions has not call JsRef.freeRecursive(setToGlobalObject)
  2. for function XMLHttpRequest(), in extensions/xhr.dart,JavascriptRuntimeXhrExtension#enableXhr,has not call JsRef.freeRecursive(evalXhrResult.rawResult)
final evalXhrResult = this.evaluate(xhrJsCode);
if (_XHR_DEBUG) print('RESULT evalXhrResult: $evalXhrResult');
  1. for function FLUTTER_NATIVEJS_MakeQuerablePromise(promise),JavascriptRuntime.localContext save JS value,need to JsRef.freeRecursive it' values too.

In addition, I find in other place also has not free ref.

  1. extensions/handler_promises.dart,HandlePromises#_doHandlePromise,final fnRegisterPromiseFunction = evaluate(REGISTER_PROMISE_FUNCTION);,has not call JsRef.freeRecursive(fnRegisterPromiseFunction.rawResult)
  • but this place maybe only for JavaScriptCore ,no about QuickJs(for Promise always covert to Future)

maybe every place use evaluate to get function has not free JsRef.

hope someone to update it!!!!!

@iulian0512
Copy link

it's a good library, hope it does not get abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants