Giter Club home page Giter Club logo

Comments (19)

suicvne avatar suicvne commented on August 22, 2024

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.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

One.

Soon to be Three though.

from discordsharp.

suicvne avatar suicvne commented on August 22, 2024

o.O that shouldn't be happening then

from discordsharp.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

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.

suicvne avatar suicvne commented on August 22, 2024

image

from discordsharp.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

oom

This is where we are at currently :-)

from discordsharp.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

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.

suicvne avatar suicvne commented on August 22, 2024

It pulls from the pdb file auto generated.

from discordsharp.

suicvne avatar suicvne commented on August 22, 2024

image
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.

suicvne avatar suicvne commented on August 22, 2024

image
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.

image

from discordsharp.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

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.

suicvne avatar suicvne commented on August 22, 2024

Interesting. Well, I can add an option in the client constructor to disable logging at least :)

from discordsharp.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

If that is what is causing the issue then yes that would be good

from discordsharp.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

I also don't have a logs folder I take it that's something you've coded in

from discordsharp.

suicvne avatar suicvne commented on August 22, 2024

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.

Jimmy062006 avatar Jimmy062006 commented on August 22, 2024

After tidying code up a little this issue seem's to have gone.

from discordsharp.

suicvne avatar suicvne commented on August 22, 2024

👌

from discordsharp.

 avatar commented on August 22, 2024

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.

suicvne avatar suicvne commented on August 22, 2024

you shouldn't be running those methods yourself

from discordsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.