Closed Ekidoxx closed 5 years ago
Is anyone who has same error?
I recognized myself, that I didn't have this issue since the beginning of using Your package, so I thought I'd check if maybe Discord being launched has anything to do with the problem... And that's the test result:
What | RAM usage |
---|---|
Discord | ~245 MB |
Atom | ~885 MB* |
Discord and Atom | ~250 MB / ~890 MB |
Atom with atom-discord package | ~2.350 MB* |
Discord and Atom with atom-discord package | ~245 MB / ~900 MB |
* Installed some more packages since creating this issue
However, after I launched both Discord and Atom with the package, and then closed Discord, RAM usage didn't increase back to the ~2.350 MB as I expected.
So, to me it seems like on launch the script(s) don't detect properly when to send rich presence information - and when incorrectly trying to send those into ether (as no Discord is running), something keeps looping something until being about to kill Atom. But that's just my thought, since I didn't understand even half the code :P
For more information, please refer to #35
I can reproduce the issue exactly like @Ekidoxx described, the only difference that I have noticed in my case is that in addition to using up way more ram is that it also makes my CPU usage go up drastically (~125% according to htop
)
Here's some system information:
OS: Arch Linux x86_64
(Kernel: 4.14.12-1-ARCH
)
RAM: 8GB
Atom version: 1.23.2
Package version: 1.4.0
Hmm, I actually didn't even thought of checking CPU usage... Gonna test it once I have bit more free time
Same here, easily reproducible by starting Atom w/ the package without Discord running, letting it steadily accumulate memory usage while at ~40%+ CPU usage, and watching both immediately dip to normal by launching Discord. Closing Discord at that point does not cause the issue to reoccur.
Specs:
OS: Windows 10
RAM: 8GB
Atom version: 1.23.3
Package version: 1.4.0
Guys we need more information, can I ask you guys to test this issue while no tabs are being open except from the settings tab to enable/disable the package?
The reason for that is because Atom uses Electron and for every tab which you'll open another process will run in the background. Which, obviously will cost with RAM usage
I suppose that IPC call when Discord is not running raised this error. So, I think checking is discord online using ps-node may help solving this error.
Started Atom with atom-discord
. The package took 850ms to load, CPU usage stayed around 60 to 80% and RAM usage kept increasing until my system actually had to use the swap space. I could travel to the moon and back between when i opened a file and when Atom displayed it.
Clearly there is a memory leak somewhere.
Specs: OS: Arch Linux w/ Gnome RAM: 8GB + 4GB swap (Atom used a total of 7GB before i shut it down) Latest version of everything.
When I tested two cases: with Discord and without Discord, I failed to reproduce this error. Maybe there is another factor to memory leak.
What | RAM usage |
---|---|
Atom w/ atom-discord package w/o Discord | ~280 MB |
Atom w/ atom-discord package w/o Discord, 2 windows | ~280 + 330 MB |
Atom w/ atom-discord package, Discord | ~290 MB |
OS: Windows 10
RAM: 12GB
Atom Version: 1.23.0-beta1
Package Version: 1.4.0
Any idea on what I/We could edit locally to check out if that would fix the issue?
@HelloWorld017 Are you sure that you have checked it with package version 1.4.0
and not with what's in master-branch?
Because once a weird thought came to me, I uninstalled the package and then manually installed it with content of this repo (as there were some commits that didn't get published under new release version) - And guess what, the bug has been fixed! :scream:
So, how about You'd soon release 1.4.1
? :stuck_out_tongue:
But before you do that, there's bug with latest issue and its merged pullrequest (https://github.com/HelloWorld017/atom-discord/issues/39 & https://github.com/HelloWorld017/atom-discord/pull/38)
I uploaded 1.5.0
to the apm! 😄
Is anyone can confirm disappearance of this issue? 😆
The issue still persists.
Atom drains memory and uses the CPU like crazy until discord is started.
Closing discord again afterwards does not make the RAM be used up anymore.
The dev console in Atom does not show any errors while it is using up CPU and memory
Would you tell me if the memory leak happens on the renderer process?
Also, would you get console output from the terminal?
I think that dumping heap might help solving this issue.
Ok, with every next day it's getting more weird @HelloWorld017. After I updated the package through Atom, I again have this issue o.0'
I hope this bug happens to me
Would you get terminal output and check if this leak is happening on renderer process or on main process?
You mean by using one of these: output-panel / atom-terminal-panel?
Umm... Actually I meant the cmd. If you open the cmd at the directory where atom executable is and execute atom by cmd, you can see logs of atom main process.
Seems that I do something wrong, because I can't manage to get any log output anywhere... When I do atom -l
, atom -l ./atom.log
, atom --log-file Atom.log
, atom --log-file "Atom.log"
no output is shown in command prompt, and no log file is created
@HelloWorld017 Seems like it's happening in the main process. I performed some tests using htop
in a terminal:
Running Atom without atom-discord
:
After enable & restart :
When enabled, Atom's main process uses 60% of CPU (htop outputs the usage by core, so 150% CPU means a core and a half running at full speed) and eats about 30mb of RAM per second, definitely a leak.
I'm going to try snooping around your code ('cuz i really want the darn thing to work). Can you confirm that you can't reproduce the issue on your end?
There is definitely a leak. But, I can't reproduce on my end and I'll upload screenshot and data next day. Anyway I am investigating the codes.
The reasons I thinking is
atom-discord: Disabled
atom-discord: Enabled
Discord Client: Turned on
atom-discord: Enabled
Discord Client: Turned off
Could anyone check this issue persists after f41c42963fc8135c29419a9f6a8368717cb2fd6f?
I had the problem, and now, after almost 45 minutes running, I had no leakage.
Okey, I can reproduce this on macOS, and its really bad.
Atom with atom-discord with Discord turned off:
Atom with atom-discord with Discord turned on: (No need to reboot Atom, just started Discord)
Atom is totally unsable on a Mac if Discord is not running. Its lagging to the point that you can't even scroll/type... :/
Does this issue persist after setting interval to a very long-term? If this issue related to sending IPC packets, it will disappear because ipc won't be sent because of very long interval.
No, even if I set a big interval (60 000ms) the CPU is still at 100%.
But when I start Discord up, the CPU goes down to 1%.
That's interesting. I'll make start discord rpc client when the discord exists in the process list.
Any progress on this issue? Still getting it on macOS
I think this error is related to discordjs/RPC#17 I'll try updating discord-rpc to latest.
If that does not fix issue, I'll make rpc not run when discord is not runnning manually.
Description
Few seconds after launching the editor, this package makes Atom slowly increasing used RAM until it's consuming about 2,1 GB of memory - while in my case, normally, Atom uses around 700 MB. This makes whole editor either work amazingly slow, or even stuck at all...
Environment informations
Operating system: Windows 7 Home Premium 64-bit SP1 with 12,0GB RAM Atom version: 1.23.1 Package version: 1.4.0 Startup time addition: 355ms Reproduction rate: 100%