Linux Espruino - websocket send - 4 jsVars leaking each time #7184
Replies: 1 comment
-
Posted at 2017-08-17 by Wilberforce Here is the code (which won't run in isolation) as it requires files too...
Posted at 2017-08-17 by @gfwilliams Hmm... Is this a proper 'leak' - as in - you type Posted at 2017-08-17 by Wilberforce Thanks for the reply.. In chrome on the receiving end of the web socket, I can see the json packets coming in 106 bytes at a time, so they are getting sent once... so I wonder if this is a bug related to the fact that the websocket does not close, so the current data gets added to the queue, the most recent addition gets sent, but because the socket is not closed, the queue keeps on growing. Probably not explained myself very well! I'll have to try the quit() tomorrow.. Posted at 2017-08-17 by @gfwilliams It's possible, yes... So there's no data being taken off the beginning of Posted at 2017-08-17 by @gfwilliams I just tried this:
and it works fine - I don't see any leak at all. However, when I remove So yeah, that's it. I reckon the connection is actually closing properly, we're just accepting I filed an issue: espruino/Espruino#1220 Posted at 2017-08-17 by @gfwilliams Fixed now. Your code will error after that, and you just need to clear the Posted at 2017-08-17 by Wilberforce @gfwilliams I have added the When you mentioned Posted at 2017-08-18 by @gfwilliams It's a linux-only thing. Basically it quits 'nicely', and then runs a quick check for leaked memory afterwards :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-08-17 by Wilberforce
This is running on the linux version of espurino, and will apply to other boards too.
It looks like the dSnd part of the underyling socket is growing each second evert time the
model
is updated...I've tried to do a simplier use case, but have not yet got a simple case working, so I'll just post what I have so far...
the output of
trace()
shows the dSnd string getting larger each iteration...Beta Was this translation helpful? Give feedback.
All reactions