Skip to content
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

Memory leak is still happen in both of newest version and prior version. #64

Open
BADEnder opened this issue Nov 2, 2022 · 13 comments
Open

Comments

@BADEnder
Copy link

BADEnder commented Nov 2, 2022

Memory Leak Case

There is Memory leak problem in both of your newest version 0.7.3 and prior version 0.3.3.

The testing flow was that you mentioned in the previous issue,
but I changed the input more quick, For example, 7200pcs / 5 seconds, and change the delay node to 10msg/s
(My work space need the input more large and more fast)

In this case, after running node-red around 1.5hours, the memory usage in node-red from 4% to 40%, and then node-red crashed.
Crashed again no matter how much times node-red restart.


Problem Solved after I modified your code, and very pleasure to improve your code.

However, I changed lots of your version 0.3.3 code, and actually there is no memory leak again, the problem is solving.
I am pleasure to help you to improve your code or maybe you can merge my code, but first I have couples of questions for you:

  1. First of all, why did you use the module mustache and others for the MS-SQL configuration input? After I saw the page of module mustache page, I found that was major use for HTML template, am I correct? Therefore, I tried to delete it all in the red frame of picture (as shown below), I found the output that was no difference to your origin code. Here is your version 0.3.3 code:
    image
    Could you simply explain me what you were doing here?

  2. Second, I noticed that you create new promise object for every node-mssql input, I am not sure whether the node-red use the cahch for every node. If yes, I guess that was very big problem. Why did you create a new promise object to include node-mssql promise object?

After I deleted these two point, and modified the code, the memory leak was never happen again even thought I set the input 9700 msg / 2 seconds, and total input 70 million messages.

Please help me, thanks.

@adikos
Copy link

adikos commented Jan 7, 2023

Hi @BADEnder,
I'm facing the same memory leakage with 0.7.3 version. Can you upload your corrected version to give it a try?
Thanks.

@uoral
Copy link

uoral commented Jan 16, 2023

Hello Mr. @Steve-Mcl ,

I'm facing that memory leakage problem too. Please update that version. Thank you so much.

@BADEnder
Copy link
Author

BADEnder commented Feb 2, 2023

@adikos The version I modified is version 0.3.3 as the picture above, not version 0.7.3

@uoral
Copy link

uoral commented Feb 6, 2023

Hi @BADEnder ,

How can we modify that code?. Can you please explain that. With a program? I deleted the parts in the picture from the mssql.js file, but it didn't work. Please help me. Thank you.

@uoral
Copy link

uoral commented Feb 7, 2023

Hello Mr @bestlong ,

Because of this problem(constant loss of ram) my program is not working properly and after a while the program gets blocked. Please a solution here. Thank you so much.

Kind regards.

bestlong added a commit that referenced this issue Feb 7, 2023
@bestlong
Copy link
Owner

bestlong commented Feb 7, 2023

Hi @BADEnder @PyregTechnologie

Now node can disable parse mustache.

@uoral
Copy link

uoral commented Feb 7, 2023

Hi Mr. @bestlong,

First of all, thank you very much for your quick response. Do we need to reinstall Mssql-plus Node? How can I implement this change in the code?

Kind Regards

@BADEnder
Copy link
Author

BADEnder commented Feb 7, 2023

@PyregTechnologie

If you use the version 0.3.3, you can just replace the mssql.js in "src" directory with the link below:

https://github.com/BADEnder/node-red-contrib-mssql-plus-m/blob/master/mssql.js

Not only delete the mustache and others, but also add some code referred to the module named "node-mssql"

@bestlong
Copy link
Owner

bestlong commented Feb 8, 2023

Hi @PyregTechnologie

First of all, thank you very much for your quick response. Do we need to reinstall Mssql-plus Node? How can I implement this change in the code?

Kind Regards

go to Manage palette update node and restart nodered.

then edit node property uncheck parse mustache

@uoral
Copy link

uoral commented Feb 8, 2023

Hi @BADEnder @bestlong ,

Thank you very much for your answers and solutions.

Kind Regards

@bestlong
Copy link
Owner

bestlong commented Feb 9, 2023

If you use the version 0.3.3, you can just replace the mssql.js in "src" directory with the link below:

https://github.com/BADEnder/node-red-contrib-mssql-plus-m/blob/master/mssql.js

Not only delete the mustache and others, but also add some code referred to the module named "node-mssql"

Hi @BADEnder

We can't see node-red-contrib-mssql-plus-m. Private repository ?

@BADEnder
Copy link
Author

BADEnder commented Feb 9, 2023

Sorry, that's my fault, and it's public now.
If you have any concern about the code, please let me know, thanks.

@BADEnder
Copy link
Author

Hi @bestlong, what do you think after reviewed my modified code?

By the way, I test your newest version 0.10.x this Monday, and still got the memory leak.

In my opinion, maybe that's about the code creating a new promise object in node-red instead of using the promise object that's already built in the module "node-mssql".
Therefore, I guess that the memory will keep going up if you don't delete those object to release the memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants