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

Author Topic: SFML 2.0 Memory Leak?  (Read 1966 times)

0 Members and 1 Guest are viewing this topic.

Fjerdue

  • Guest
SFML 2.0 Memory Leak?
« on: August 02, 2012, 04:33:20 pm »
Hello.

I just compiled SFML 2.0 myself with MinGW 4.7. I made a minimal RenderWindow with an event loop and found out that the memory usage of the program keeps rising. So I removed the event loop and found out that the problem is either in the clear() or display() function.

Using this code:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow App(sf::VideoMode(640, 480), "Leak");

    while(App.isOpen())
    {
        App.clear();

        App.display();
    }

    return 0;
}
 

compiled with MinGW 4.7 on Windows 7 64bit statically linked the memory usage starts at about 27-28 MB and then starts rising.
« Last Edit: August 02, 2012, 04:44:30 pm by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Memory Leak?
« Reply #1 on: August 02, 2012, 04:44:49 pm »
It's most likely a leak in your graphics driver. Is it up to date?
Laurent Gomila - SFML developer

Fjerdue

  • Guest
Re: SFML 2.0 Memory Leak?
« Reply #2 on: August 02, 2012, 04:55:45 pm »
Yep. My graphics drivers are up to date.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10989
    • View Profile
    • development blog
    • Email
Re: SFML 2.0 Memory Leak?
« Reply #3 on: August 02, 2012, 05:14:54 pm »
I just compiled SFML 2.0 myself with MinGW 4.7.
Does "just" mean right now, like commit db1f1b8fa1006ea440b9cbe4a2d61b632109ebb2?

...the memory usage starts at about 27-28 MB and then starts rising.
Define rising a bit more. A few bytes per second or 100MB a minute?

Additionally there are tools to find the source of memory leaks, so it's adviced to use one and tell us where/what is leaking. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Fjerdue

  • Guest
Re: SFML 2.0 Memory Leak?
« Reply #4 on: August 02, 2012, 05:24:17 pm »
I compiled the source from 31 june.

In the beginning it rises somewhere between 20 and 100 kB/s with occasional 2-3 MB rises. Then after a minute or so it gets static for a couple of second at around 48 MB then rises with about 3-6MB and keeps going on like that - pause - rise - pause - rise.

Could you recommend me one of those tools? :P

 

anything