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

Author Topic: Game used memory is keep rising  (Read 755 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 1
    • View Profile
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.Closed += WinOnClose;
            SF_GameWindow.Resized += WinOnResize;

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

                GameInstance.CallEvent(ProximaGameEvent.OnUpdate); //game update call
                GameInstance.CallEvent(ProximaGameEvent.OnDraw);  //game render call(in-view)
                GameInstance.CallEvent(ProximaGameEvent.OnUIDraw); //game ui draw call (off-view)
                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)