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 #2698

Open
ngiotta opened this issue Mar 3, 2024 · 15 comments
Open

Memory Leak #2698

ngiotta opened this issue Mar 3, 2024 · 15 comments
Assignees
Labels
answered question Further information is requested

Comments

@ngiotta
Copy link

ngiotta commented Mar 3, 2024

In the later versions of Rainbowminer, there seems to be a massive memory leak. It's using over 3.2GB RAM.

Screenshot 2024-03-02 221419

@RainbowMiner
Copy link
Owner

RainbowMiner commented Mar 3, 2024

Which version of the powershell core are you using?

I ask this, because there is a known memory leak in Powershell Core v7.3+
In case you have installed a higher version than v7.2.x, please downgrade to a v7.2.x version. Then, the memory leak should be gone.

@RainbowMiner RainbowMiner self-assigned this Mar 3, 2024
@ngiotta
Copy link
Author

ngiotta commented Mar 3, 2024

Good to know. I have 7.4.1.5. I will try downgrading. Thanks.

@UselessGuru
Copy link
Contributor

@ngiotta
Any better with 7.2.x?

@RainbowMiner RainbowMiner added question Further information is requested answered labels Mar 6, 2024
@ngiotta
Copy link
Author

ngiotta commented Mar 19, 2024

@ngiotta Any better with 7.2.x?

Nope. I uninstalled PS and installed 7.2.18 and the memory leak remains. Seems to only be on my W11 boxes. I'm just not going to run Rainbow on those machines, because it's so bad, they start crashing.

@mr-manuel
Copy link

mr-manuel commented Mar 19, 2024

I have the same problem with any version of PowerShell. Tried with various v5.x.x and v7.x.x. versions. Tested Windows versions are Windows 10 22H2 and Windows 11 21H2.

In total I tried it on 5 different systems with the same result. The systems have all at least 8 GB of RAM and 27500 MB of reserved page file.

Rainbox Miner is on version v4.9.1.9.

After some hours the PowerShell process reaches 33 GB until it crashes. I started it at 13:35:26 and it crashed on 22:34:52, nearly 9 hours after start.

The mining process is still running and not affected by the crash, but the coins are not switched anymore.

Event ID 2004 in the Windows Evenlog:

Windows has diagnosed that the virtual memory is insufficient. The following programs occupied the most virtual memory: powershell.exe (10944) occupied 34995109888 bytes, MsMpEng.exe (3668) occupied 271937536 bytes and SearchApp.exe (7884) occupied 116056064 bytes.

Could you implement a workaround, that the PowerShell script restarts itself, if it reaches a configured memory threshold?

@RainbowMiner
Copy link
Owner

That's strange - all my Win10 systems with Powershell Core v7.2.18 run stable at around 250MByte memory consumption. Could you please upload a Debug file? Maybe there is a faulty pool module.

@RainbowMiner
Copy link
Owner

Could you implement a workaround, that the PowerShell script restarts itself, if it reaches a configured memory threshold?

That is in fact a very good idea. I will add this workaround until we find the culprit.

@mr-manuel
Copy link

mr-manuel commented Mar 19, 2024

Have you a link to a documentation on how to create a debug file?

Found it in another issue:

Could you please upload a Debug file (http://localhost:4000/, click "Debug file" on the left hand side)?

Can I send you the logs via mail or Discord for privacy?

@RainbowMiner
Copy link
Owner

Can I send you the logs via mail or Discord for privacy?

Sure: send it to info@rbminer.net

@UselessGuru
Copy link
Contributor

UselessGuru commented Mar 21, 2024

That's strange - all my Win10 systems with Powershell Core v7.2.18 run stable at around 250MByte memory consumption

I am not actively using RBM, but I can confirm that all PWSH versions I have tested so far (7.2.18, 7.3.x, 7.4.1 & 4.5.0/1/2rc) have a memory leak (approx 300MB/day) when running UG-Miner which uses a lot of similar code. This is with W11 23H2 (22631.3296)

@RoyCRoderickIII
Copy link

I dont think its RBM personally, i have both a very crappy windows laptop running Win 10 pro, and my pi running ubuntu 22.04 and neither get above 6GB of ram.usage running daily. So it has to be a miner issue, seeing i dont GPU mine at all.

@UselessGuru
Copy link
Contributor

UselessGuru commented Mar 21, 2024

So it has to be a miner issue, seeing i dont GPU mine at all.

Nope, I even see the mem leak when just running UG-Miner in 'dry run' mode (constantly querying pools & building miner objects to get the most profitable miners, but not actually running miners).

I suspect that the mem leak has something to do with custom classes used in both projects (e.g. classes device, pool & miner).
With UG-miner I occasionally (after a few hours of flawless running) I see GC messing up and breaking custom class methods (they worked in 100s of cycles, then fail suddenly, and are working again in the next cycle).

@RoyCRoderickIII
Copy link

So it has to be a miner issue, seeing i dont GPU mine at all.

Nope, I even see the mem leak when just running UG-Miner running in 'dry run' mode (constantly querying pools & building miner objects to get the most profitable miners, but not actually running miners).

Thats kinda my point, if it was RBM in general, all of us would be experiencing it, or just the window versions etc. it must be either a miner issue or the way RBM opens/closes the miner or miner version.

@UselessGuru
Copy link
Contributor

UselessGuru commented Mar 21, 2024

it must be either a miner issue or the way RBM opens/closes the miner or miner version.

Not in my case. The mem leak is happing regardless of miners getting launched or not. It is the processes used to get the pools & miners. Not the miners getting executed.

@mr-manuel
Copy link

I can confirm that. Only the managing process crashes, the miner itself continues to mine.

RainbowMiner added a commit that referenced this issue Mar 26, 2024
- add parameters "RestartRBMTimespan" and "RestartRBMMemory" to config.txt (issue #2698)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants