I wrote a simple application, which exposed a custom type (i.e. Foo) to outside. So the user could invoke it's method like this:
So I am quite worried about this, if a lot of users would create instance of Foo, it would consume very a lot of memories, which seems terrible.
Any thoughts over this problem?
var val1 = new Foo();
Console.WriteLine(val1.Method());
From the memory detecting tool, I found the memory increased a lot after each time I ran this simple script. It seems a lot of Microsoft.ClearScript.HostItem objects exists in memory, and never gone away. So I am quite worried about this, if a lot of users would create instance of Foo, it would consume very a lot of memories, which seems terrible.
Any thoughts over this problem?