-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 1.2.0 crashing node red if Show Hidden Files selected #18
Comments
There appears to be some high memory use in there. and the garbage collector then fails to clear enough heap space. Happens on Windows not just Linux. Not sure if Paul (@juggledad) can see what the issue might be. I'll try to take a look if I get time. Clearly related to PR #17 |
With Colin's flow, if I flood the node with a lot of msg's, I do see a slowdown (on my Pi3) but it is doing a recursive search. I'm sure on a pi zero (w) it will be worse due to the slower processer and it having only 512 MB of ram. I don't know if there is a way to single thread the calls to readdirp to let if finish one before processing the next... |
No, this is much more than limited resources. I'm running it on an Intel i7 with 16GB of RAM and it still fails. Looking at the memory utilisation, I can see that heap is being allocated much faster than it is being cleared. If you run it say 10 times and then stop for 2 minutes or so, you should find that you can do the same again. I think this is something to do with readdirp |
Also the depth is set to 0 so it is only doing a single level isn't it? |
Another test shows that once readdirp is called a second time before the first finishes, that appears to be when it crashes: I think that we have to say that readdirp just isn't up to the job. Time to look for an alternative library? There really isn't anything complex in the node itself, all the work is done in readdirp. I've checked that the node isn't doing anything odd with variable allocation and it doesn't appear to be a normal memory leak. |
What is the significance of Show Hidden Files in this though? Also the previous version doesn't suffer from the problem as far as I can tell. |
Ahhh, I just caused it to crash NR on my Mac. I had to flood it with a lot of requests and I got a bunch os 'server not responding' windows then NR crashed. Not sure if this will help, but this is the log
|
The previous version wasn't looking at the folders correctly. Now it is iterating thru folders to look for the files and it is looking thru all the hidden folders too. |
OK, good call. Definitely only happening with the hidden files option turned on. Without that, I can run it loads of times very quickly with no issues. RSS does go up slowly but the heap goes up and down as expected. |
It isn't iterating through ../ is it? |
It shouldn't be because you've got it set to files only.
|
OK, found the issue! Inside the They didn't need to be inside there and should be outside the input function. That's where I've moved them to and it makes a MASSIVE difference! Gotta run for tea right now. I'll try to get a new version out tonight if I can but I've a few things to do so I might have to wait for a day or so. |
Fixed in v1.3.1 - thanks for your help and support. |
Software and Package Versions
How is Node-RED installed?
Using the Pi install script
To reproduce
Configure the fs list node to show hidden files, and drive it via an inject node. Click the inject node about 20 times, it is not necessary to do it fast as far as I can see. Node red crashes with the error below.
Clearing Show Hidden Files appears to solve the problem.
Rolling back to v1.1.1 also solves it.
On a Pi Zero running Raspbian the same situation hogs the processor rather than crashing it.
Sample flow:
Node red log:
The text was updated successfully, but these errors were encountered: