Based on the dfx version you use, the panic comes from an attempt to mprotect a memory region here. The man page has some information on when ENOMEM might be returned; besides not having enough memory which you said you have enough, the rest might point to some bug.
I’m not very familiar with the memory tracker myself, Ulan would be the expert on this, so probably best to wait for him to reply.
Hi @dymayday. The error is caused by the Wasm execution hitting the maximum limit of virtual memory regions configured on your system. You can change the limit using this command:
That’s an interesting behavior that I’m interested to hear your opinion about as it happens when I mem:take or delete a lot of data from a struct stored in a thread_local!.
Would you happen to know what is happening under the hood for this to happen ?
My guess would be that these operations trigger a long chain of object drops that access a lot of memory. Internally that causes creation of virtual memory maps in the Wasm executor.