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

Script object memory footprint grows as it's used multiple times #227

Closed
kevdev424 opened this issue May 15, 2018 · 0 comments
Closed

Script object memory footprint grows as it's used multiple times #227

kevdev424 opened this issue May 15, 2018 · 0 comments

Comments

@kevdev424
Copy link

Hey, not sure if this is expected or not but it seems each use of a Script object increases it's size. I've created a pool of Script objects and have a system to reuse them because construction is expensive and they shouldn't hold any state aside from the Lua I wish to run.

My use case is pretty trival:

var script = new Script();
script.DoString(ScriptOfLuaFunctions);

for(int i = 0; i <= 1000, i++) {
   var table = new Table(script)
   // add stuff to the table here
   var result = script.Call(script.Globals["myfunction"], randomParam1, table)
}

When creating the Table or using Call, is there some extra state being added to Script somewhere? To me this use case looks like it should be stateless.

Thanks

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

1 participant