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

Overflowing the memory #37

Open
ben-page opened this issue Feb 15, 2022 · 1 comment
Open

Overflowing the memory #37

ben-page opened this issue Feb 15, 2022 · 1 comment

Comments

@ben-page
Copy link

My application was intermittently overflowing the memory store.

What I discovered is that Policy_opa_malloc and Policy_opa_heap_ptr_get will automatically grow (add pages) the memory store, but _envMemory.WriteString() does not - for obvious reason.

So if FastEvaluate() is called when _dataHeapPtr is near the end of the memory store, it can overflow the store. I created a PR to simply check the memory capacity and grow as necessary.

I also noticed that the memory allocated for the initial GetData wasn't reused if different data was loaded.

@ben-page
Copy link
Author

#36

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