-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 with single process #2512
Comments
That really is a lot of memory. You could help narrowing down the issue by disabling a few Agents and then check if memory usage is still that high. I have 119 Agents on my instance and it's using 700 MB combined (I am using the single-process images). If you know about Agents that fetch particular large website or download files those would be my first suspect. |
if one of the agent will download a JSON file which is greater than 16MB size by command line agent. Will it affect? |
Moreover, except stopping agent to check which agent lead to memory leak. What else can I do to check where the memory leak occurs. |
No the memory usage is only affected by operations that are done in Ruby, if you the output of the ShellCommandAgent is also big it could be a factor though.
As far as I know there isn't a great way. I think the quickest test would be to disable all Agents/Scenarios, then restart the instance. While monitoring the memory usage enable one Scenario/Agent chain run it and check the memory usage. Then either restart the services or directly continue with the next Agent chain. Does the memory usage climb beyond 6GB or does it creep up to that and then stays there? |
True, the ShellCommandAgent output is outputting the whole 16MB JSON. |
It used up to 6GB because we limited the memory size of the container. I think it will climb more than 6GB without memory limitation. |
Not 100% sure about that, if the processes really need more memory to work it should cause out of memory issues. Can you share the scenarios that cause your instance to use that much memory? |
Sorry for the late replay, I tried to stop some scenarios. And I observed the memory usage did increase slowly. Here is the scenario. And the memory usage diagram. |
Likewise 😄
Ok that looks more like a common memory usage schema of Huginn/RoR applications. The usage climbs but then plateaus at a reasonable amount. I did see you are storing some information in the Agent memory in "Huginn memorise site status" is it possible that the memory of that Agents get really big (as in dozens or more MB)? You should be able to inspect the memory on the Agent detail page. |
I didn't saw any large JSON in the memory. Here is the example: {
"ME": 0,
"EKIEd": 0,
"HKPhil": 0,
"OEM": 0,
"YM": 0,
"the Patsy eshop": 0,
"YM Balloon": 0,
"Swan Select": 0,
"Vcity": 0,
"HKTDC Design Gallery": 0,
"AFinder": 0,
"Education-plus": 0
} Will the memory usage climb due to the change of the agent memory every 1m? |
Sorry for the massive delay I have been traveling last week and thought I would get work done, but didn't 😄
It shouldn't, the RAM required to run the Agent should correlate with the size of the memory of the Agent, your structure looks like it would only grow when new sites are added. In fact all the Agents of the Scenario don't look like they should cause a memory leak/bloat that big. Are you sure that the scenario you shared causes the high memory usage? You mentioned something that you handle megabyte big JSON files but I don't see the status monitoring Agents doing that. |
Yes, I am sure this agent cause the memory usage climb. You can also try it in your environment. |
Doing that right now, ill report back how the memory usage looks on my instance after a few hours. |
I am seeing the leak as well, guessing it's caused by the JavascriptAgent, but I need more time to dig into it. |
OK, thanks. Feels free to update me. |
Can you test out this image? |
It fixed my problem. However, will it be merged into the master branch? Or in case, will you image keeping update for including the new features? |
@dsander Thanks for the help. I will keep eyes on the memory usage. |
We just merged the fix, you can switch back to the normal image. |
@dsander Thank you very much. |
Hi everyone, running my Huginn with single process container and external database image lead to memory leak. The peak of memory usage after one week with 35+ agent is 6 GB. May I ask is there any solution to solve high memory usage.
The text was updated successfully, but these errors were encountered: