Comments (19)
yeah it literally logs everything.
i can add a toggle in dev branch to enable/disable logging but i won't be pushing it to nuget yet
how many servers is your bot on?
from discordsharp.
One.
Soon to be Three though.
from discordsharp.
o.O that shouldn't be happening then
from discordsharp.
It's running in debug mode currently. I'm going to keep taking memory snapshots to see what it increasing. Currently though it looks like only the log's
from discordsharp.
from discordsharp.
This is where we are at currently :-)
from discordsharp.
As a side note it seems something is hard coded my websocketlog.txt has these lines.
at DiscordSharp.DiscordClient.<Connect>b__233_5(Object sender, EventArgs e) in C:\Users\Mike\Documents\GitHub\DiscordSharp\DiscordSharp\DiscordClient.cs:line 1669
My names not Mike :P
from discordsharp.
It pulls from the pdb file auto generated.
from discordsharp.
This is what i'm seeing. it seems to top out around 40mb and I'd expect it to increase with say, more servers or after a long day of logging messages and json events. Personally, I've never experienced any OOM issues (granted, I'm running 64-bit processor, 12gb of RAM. but even then: DiscordSharp is a 32bit dll at the moment and so is my test bot).
from discordsharp.
I dump logs when I'm done running my bot and these are the average sizes. However, I log as much as I can for debug information.
from discordsharp.
Yeah. I've made some changes but it was after a few hours of running and seemed to happen when there was connection issues.
It's running now with some modified code and I've got a 64bit processor and 16Gb ram (or more lol) so I'm not sure whats going on there :-) All my bot does is run a timer pull a webpage with just a version string on it and posts if the new version is larger.
from discordsharp.
Interesting. Well, I can add an option in the client constructor to disable logging at least :)
from discordsharp.
If that is what is causing the issue then yes that would be good
from discordsharp.
I also don't have a logs folder I take it that's something you've coded in
from discordsharp.
Yes, that's something that I've included on my bot's side
public void Cleanup()
{
if (client.GetTextClientLogger.EnableLogging)
{
if (!Directory.Exists("logs"))
Directory.CreateDirectory("logs");
var date = DateTime.Now;
string mmddyy = $"{date.Month}-{date.Day}-{date.Year}";
if (!Directory.Exists("logs/" + mmddyy))
Directory.CreateDirectory("logs/" + mmddyy);
int levels = (int)(MessageLevel.Debug & MessageLevel.Error & MessageLevel.Critical & MessageLevel.Warning);
client.GetTextClientLogger.Save($"logs/{mmddyy}/{date.Month}-{date.Day}-{date.Year} {date.Hour}-{date.Minute}-{date.Second}.log", (MessageLevel)levels);
}
}
The EnableLogging
property is new in this commit i'm about to push out to dev.
from discordsharp.
After tidying code up a little this issue seem's to have gone.
from discordsharp.
👌
from discordsharp.
This is still an issue, the logger does eat gigabytes (never cleans up the log list) - but DiscordMember, and DiscordRole are also culprits. Running multiple GetServerList() and GetChannelList() cause memory leaks.
from discordsharp.
you shouldn't be running those methods yourself
from discordsharp.
Related Issues (20)
- Usernames are not updated while running HOT 5
- Audio Packets not being recieved HOT 2
- DiscordServer.CreateChannel returns object reference not set to an instance of an object when creating voice channel HOT 2
- Feature Request - MoveMember
- discordspecialpermissions administrator permission check HOT 2
- Mono giving me issues HOT 1
- DiscordClient.Connected event handler does not fire HOT 7
- (429) TOO MANY REQUESTS. HOT 4
- Question: How do I send a message to a specific channel? HOT 1
- Attach/Send File to a Certain User
- WebSocket randomly closing. HOT 4
- Add Feature - Remove Member/User from role
- Audio Help!? HOT 2
- 2FA HOT 3
- Is this still being worked on? HOT 1
- Connecting to the message authors voice channel returns NPE
- SetGame won't display the game
- Receiving Images Help HOT 2
- Logging in with bot token? HOT 3
- Set a Status on account HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discordsharp.