Open JGiter opened 2 years ago
I can't reproduce it locally. Could you give us the Node version you're using, the environment, and an example VP?
I am using Node 16 on Ubuntu 20.04.4. To reproduce it I don't even create VP, just run script with code above
@sbihel
I can't reproduce it locally.
Which Node version were you using when trying to reproduce? Perhaps we can try with your version
Sorry for not keeping you updated. I was previously looking at the heap, but indeed the RSS is large. Although my observation is that it's the instantiation (import) of didkit that's causing the increase in memory, and it never goes down.
Node 18 performs noticeably better. Otherwise, I'm still trying to figure out if it's the compiled code, or the embedded data that's the issue -- but I'm not very hopeful I'll be able to change anything in that regard. Other options include compiling to ASM or making a custom build of ssi/didkit which includes only what you need.
Thanks @sbihel
Although my observation is that it's the instantiation (import) of didkit that's causing the increase in memory, and it never goes down.
I guess you observed this when using a Node version lower than v18? Do you recall what the magnitude of RSS when doing this test with a lower version? Was it around the "500 mb" that @JGiter and I have observed?
We are trying with Node v18 and will report back.
I guess you observed this when using a Node version lower than v18?
All of them actually.
Do you recall what the magnitude of RSS when doing this test with a lower version?
Indeed, it was around 500MB with v16 and v17. With v18 it was around 200MB.
Using either
prepareIssuePresentation
orcompleteIssuePresentation
from@spruceid/didkit-wasm-node
in class definition increases memory usage by 500 mb. Issue can be reproduced with simple classThis happens only once - during the first reading of the class and lasts about 10 seconds