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

VBScriptEngine.AddHostType memory/handle leak #135

Closed
winkxoe opened this issue Sep 18, 2019 · 10 comments
Closed

VBScriptEngine.AddHostType memory/handle leak #135

winkxoe opened this issue Sep 18, 2019 · 10 comments
Assignees

Comments

@winkxoe
Copy link

winkxoe commented Sep 18, 2019

It looks like a memory/handle leak was added sometime between versions 5.5.4 and 5.5.5 when calling AddHostTiype from an instance of VBScriptEngine. I think it also affects the JScriptEngine, but not the V8ScriptEngine.

@ClearScriptLib
Copy link
Collaborator

HI @winkxoe,

Can you provide more information? How are you detecting the leak? Do you know what objects are leaked?

Thanks!

@winkxoe
Copy link
Author

winkxoe commented Sep 19, 2019 via email

@ClearScriptLib
Copy link
Collaborator

Hi @winkxoe,

A couple of questions:

  1. Which AddHostType overload are you using?
  2. Can you reproduce the leak simply by adding the AddHostType call? Or does it only happen if you call methods on the exposed type from script code?

Thanks!

@winkxoe
Copy link
Author

winkxoe commented Sep 20, 2019 via email

@ClearScriptLib
Copy link
Collaborator

Hi @winkxoe,

Unfortunately we haven't been able to reproduce your issue so far with ClearScript 5.6.0. In a test program we construct a VBScriptEngine instance, expose the Console type, and execute a small script. After 100,000 iterations the program's private memory size is around 12 MB.

Can you create a minimal sample program that reproduces the issue?

Thanks!

@winkxoe
Copy link
Author

winkxoe commented Sep 20, 2019 via email

@ClearScriptLib
Copy link
Collaborator

@winkxoe,

Thanks for posting the sample code! We've reproduced the issue and will investigate.

Cheers!

@ClearScriptLib
Copy link
Collaborator

Hi @winkxoe,

This looks like a bug in COM Interop. We'll have a workaround in the next ClearScript release. In the meantime, you might be able to bypass the issue by replacing this:

engine.Script["nextfile"] = "";

with this:

engine.Script.nextfile = "";

Good luck!

@winkxoe
Copy link
Author

winkxoe commented Sep 23, 2019

Great! Thank you very much!

ClearScriptLib added a commit that referenced this issue Dec 18, 2019
…ws (GitHub Issue #9); added support for system documents (GitHub Issue #143); added IList implementation to V8 arrays; added ExtendedHostFunctions.typeLibEnums (GitHub Issue #147); added WindowsScriptEngineFlags.MarshalDateTimeAsDate (GitHub Issue #141); fixed generic type inference for COM interfaces; fixed enumeration of COM collections that don't provide class information (GitHub Issue #146); fixed memory leak impacting Windows Script object property assignment (GitHub Issue #135); updated build and API documentation. Tested with V8 7.9.317.32.
@ClearScriptLib
Copy link
Collaborator

Fixed in ClearScript 6.0.

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

No branches or pull requests

2 participants