Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - byteouss

Pages: [1]
1
DotNet / Game used memory is keep rising
« on: May 20, 2020, 07:50:56 pm »
I noticed that my game memory is kept rising, not much, but its fact.
My game uses my own library as a game framework.
The library that I created is used SFML.NET 2.4 binaries from official bindings.
The used memory rises by 0,1mb per 2 seconds. Yes, it's not much, but its enough to have tons of used memory after handling a window for an hour.
(Note: The first time I tried my library, the rise was a 2mb per second, it was caused by creating Shape instance every draw call, but I fixed it. After I created a logger, that writes a log after any instance is created, I ran a game and the log was written only when the game is loaded, means no instances are created on draw call)
I cant show the library code because it has around 100 files and 10k lines of code. But I can show the code of window handling:

public void Run()
{
            //init sfml window
            SF_GameWindow.SetActive();
            SF_GameWindow.Closed += WinOnClose;
            SF_GameWindow.Resized += WinOnResize;

            GameInstance.CallEvent(ProximaGameEvent.OnLoad); //game load call
            while (SF_GameWindow.IsOpen)
            {
                SF_GameWindow.DispatchEvents();

                GameInstance.CallEvent(ProximaGameEvent.OnUpdate); //game update call
                SF_GameWindow.Clear(WinConfig.ClearColor.ToSFML());
                SF_GameWindow.SetView(SF_DrawView);
                GameInstance.CallEvent(ProximaGameEvent.OnDraw);  //game render call(in-view)
                SF_GameWindow.SetView(SF_GameWindow.DefaultView);
                GameInstance.CallEvent(ProximaGameEvent.OnUIDraw); //game ui draw call (off-view)
                SF_GameWindow.Display();
                deltaTime = deltaTimer.Restart(); //delta time restart
            }
            GameInstance.CallEvent(ProximaGameEvent.OnWinClose); //game close event
}
 
In a draw call i do switch to 'View', then i draw a scene, after i switch to default view, and draw a ui.
Maybe its memory leak in sfml.net or a problem really in my library?
Il tell details about the library if it will be required.
(Sorry for the grammar)

Pages: [1]
anything