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

Author Topic: Does setframelimit have a memory leak in 2.1?  (Read 5820 times)

0 Members and 1 Guest are viewing this topic.

pitchShifter

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Does setframelimit have a memory leak in 2.1?
« Reply #15 on: November 01, 2014, 11:03:59 pm »
I'm experiencing the same issue. It's weird.

I was working on a game previously and had no memory leak issues (I'm looking at it right now in Windows Task Manager - the memory usage stays the same in my game menu even though I'm drawing multiple images to the screen). I just started a new project and noticed that the memory increases by 4kb every second; and there isn't anything even being drawn to the screen.

In my new project, I added a RectangleShape with a simple border. Once I draw it to the screen, the memory increases by 40kb/sec (when I view through Windows Task Manager).

Thoughts on what it could potentially be? Like I said, my older project had no memory issue. With my new project that has barely any code in it, I'm having the memory issue.

Edit: I'm not using different versions between projects, btw.

Lamonte

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Does setframelimit have a memory leak in 2.1?
« Reply #16 on: November 01, 2014, 11:11:24 pm »
So, without win.display(), there's no combination that leaks? It doesn't make sense, because all setFramerateLimit does is to add a call to sf::sleep inside Window::display(). So if it's not the "OpenGL" part of display which leaks, nor sf::sleep, there's nothing else in Window::display() that can leak.

Can you try to find a simple OpenGL program, and check if it leaks too? It can be a pure WGL/Win32 program, or one that uses SDL 2, GLFW, FreeGlut, or whatever.

Don't waste too much time tracking the "leak" with tools, I'm 100% sure that it comes from the driver. Check my suggestions first.

And try to reduce your program more: is the event loop needed to produce the leak? Is win.clear() needed?

Yeah my original project is in SDL2 that I'm playing with and the memory doesn't go up at all sits at around not a single issue so far which sits at around 5MB of ram http://inputcoffee.net/sdl2-2/ and that's more than just opening a window which is weird to me.  Maybe there's something wrong with my dll files

Mörkö

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Does setframelimit have a memory leak in 2.1?
« Reply #17 on: November 01, 2014, 11:31:23 pm »
Possibly related: http://en.sfml-dev.org/forums/index.php?topic=15364

I haven't tested it recently so that info may be outdated. However I don't see any suspicious increases in system memory usage with my current projects (that implement more than the tutorial loop.)

Maybe it's just a quirk of the tutorial example. As one of the other posters noted: Once you start actually "doing something" in your application the rise in memory usage might stop.

 

anything