IActiveScriptParse32::ParseScriptText Memory Leak
Asked Answered
E

0

6

Has anybody ever faced a memory leak problem with IActiveScriptParse32::ParseScriptText when using it in C#? I need a ScriptEngine that is able to parse JavaScript-Code. (Everything works fine, except the used memory)

The problem is, that the longer my passed JavaScript-Code is, the more unmanaged memory is allocated by the function "ParseScriptText".

I have no idea how to free the allocated space. I actually already run Marshal.ReleaseComObject(parse32) after parsing my script but somehow the used memory does not go down anymore.

Engelhardt answered 25/6, 2019 at 14:56 Comment(5)
There are very good chances that the problem, if any (you're using managed code so are you sure there's a true memory leak) lies in your code. Can you provide a reproducing project so we can take a look at it? Also, since you're using C#, the way you do interop also matters a lot.Lacking
You can use ClearScript or examine how they have done by looking at the source code. Windows namespace in the project is the place.Izolaiztaccihuatl
Hi guys, first of all thank you for your answers. I actually found an alternative solution. I tried JINT. (github.com/sebastienros/jint) It works perfectly and does not have a memory leak or something. The only problem: It is casesensitive... This is a big problem for my project. Is there any way to ignore uppercase/lowercase in my scripts?Engelhardt
You should delete your question nowLacking
"Questions with open bounties cannot be deleted" ;)Engelhardt

© 2022 - 2024 — McMap. All rights reserved.