resource consumption in a library #2133
Replies: 2 comments
-
Posted at 2017-04-18 by @gfwilliams In the Basically you shouldn't unlock any objects that are passed in to a function or that are returned from one. It could be the extra unlock is causing the One good way to check - if your code can be compiled for desktop - is to build it to run on your PC with |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-18 by user75013 Thank you Gordon, you'r right, the problem disappears when I don't call jsvUnLock(parent); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-04-13 by user75013
Hi,
I’m currently using a PUCKJS device, for which I have added a library for specific hardware support.
The library is compiled and linked with Espruino.
I am able to load the PUCK with this new code, and invoque some functions of this library from JavaScript code running on the Espruino WEB IDE.
All of that works well, except that I can observe an abnormal memory consumption where all resources should be released.
Basically, the library contains the following code in the jswrap source:
Then, under the WEB IDE, I repeatadly execute the following lines:
At each iteration, the process.memory displays a decreasing value for the "free" field and an increasing value for the "usage" field.
Is there something missing or wrong in the close function that could explain why resource is consumed ?
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions