Skip to content

Are opa_value_add_path() / opa_value_remove_path() safe to "use in anger"? #359

Answered by srenatus
ctelfer-sophos asked this question in Wasm
Discussion options

You must be logged in to vote

Hey! Thanks for the detailed post.

But are they really safe to use repeatedly?

I think you've provided good evidence that it isn't 😅

Under what conditions would we expect OPA itself to end up leaking memory in the same way?

Those methods are called whenever a store update changes the data: all the existing Wasm VMs need to have their data updated. The code is here.

From the top of my head, I cannot tell if the Wasm VMs are decommissioned when they're not returned to the pool, or if they're kept around. If they were reset in some way, the leak wouldn't happen in OPA when using Wasm bundles. But I wouldn't bet on it, it may very well be that it's leaking memory in the same way.

I think …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@ctelfer-sophos
Comment options

@srenatus
Comment options

@ctelfer-sophos
Comment options

Answer selected by ctelfer-sophos
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Wasm
Labels
None yet
2 participants