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 - Lamonte

Pages: [1] 2 3 4
1
General / Re: Does setframelimit have a memory leak in 2.1?
« 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

2
General / Re: Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 10:51:05 pm »
I said, it's not a useful way, since you get zero information on the leak, if it even is a leak.
As I said, get a dedicated tool and figure out where the issue originates from.

What's a good tool to use?

3
General / Re: Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 10:36:48 pm »
It never stops, I've watched it increase above 2MB before I realized that shouldn't happen and stopped watching it.  Basically like I said above, it increases consistently only when window.clear+display is used with sleep or setframelimit, it doesn't happen when you use either of those without each other.

You also said it's not a reliable way to track memory usage, sure, only problem is the pattern hasn't changed lol.

4
General / Re: Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 10:26:10 pm »
So does this "leak"?

#include <SFML/System.hpp>

int main()
{
    while(true)
    {
        sf::sleep(sf::milliseconds(16));
    }
}

You said it would increase 4 KiB every second or so, how do you track that? Does it only go up?

No that doesn't leak and how I tracked it?  I watched my windows task manager memory usage increase.  The app's default memory usage would be at like 14,000K then increase by 00,004 K every second.  Now the above does not leak at all it sits at 688K and doesn't move ever.  As I mentioned above it only leaked when I had setframelimit set combined w/ the clear+display window functions or it would leak when I had the sf sleep function combined with the display/clear window functions.  having display/clear window functions without either of those the memory usage would set and sit at the amount it initiated when the application started up.  So yeah combining either of those (framelimit/sleep) with window.clear and window.display gives me a leak.  Having either set without each other does nothing just so happens to leak when paired together.

5
General / Re: AW: Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 09:49:00 pm »
You can take a look at the implementation of setFramerateLimit, as long as sf::sleep doesn't leak nothing will leak.
So you tested sf::sleep?

Built it again, leaks.

#include <SFML/Graphics.hpp>

int main()
{

        sf::RenderWindow win = sf::RenderWindow(sf::VideoMode(400, 400), "Mem Leak");

        while (win.isOpen())
        {
                sf::Event event;
                while (win.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed) {
                                win.close();
                        }
                }

                win.clear(sf::Color::Black);
                win.display();
                sf::sleep(sf::milliseconds(10));
        }

        return 0;
}

Edit:

So the above leaks with win clear/win display and sleep.  If I remove sleep with just win clear/display nothing leaks, if it's just display by itself, it leaks and if it's clear/win display + framelimit it leaks and it leaks

Edit to make the above more clear:

- having just sleep where the window clear/display code is doesn't leak.
- adding the window clear/display back leaks
- removing the sleep function with just window clear and display doesn't leak
- adding setframelimit with the window clear and display leaks
- having just the window.display leaks

6
General / Re: Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 08:51:50 pm »
Yep nothing has changed.

7
General / Re: Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 08:43:09 pm »
Things you can try:
- replace window.display() with sf::sleep(sf::milliseconds(10))
- remove window.display()

I can tell you for sure that this code does not leak in SFML. It's usually a driver issue, and the above suggestions should confirm it.

Hmm, still happens and only happens when I uncomment the win.setFrameLimit(60); line.  Going to reinstall my drivers for my gtx 770, but I doubt it's drivers because I sent the files to a buddy and he noticed it increasing too.  I noticed this originally when I used to write using the C# bindings months ago and didn't think anything of it, but yeah now using C++ it's happening.  I'll report back after reinstalling these graphics drivers.

8
General / Re: Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 08:27:52 pm »
Went to: https://github.com/SFML/SFML downloaded source configured it using CMake for VS12 '13.  Build the project.  Setup a new project w/ the new libraries and dll's (release build type), using the included folder from the master and everything built correctly, no errors.  Memory for the the .exe file when ran goes up by 4kb every second with the framelimit option set.  OS: Win764, using 32bit compile though.  Comment out the line and it doesn't increase at all.

#include <SFML/Graphics.hpp>

int main()
{

        sf::RenderWindow win = sf::RenderWindow(sf::VideoMode(400, 400), "Mem Leak");
        win.setFramerateLimit(60);

        while (win.isOpen())
        {
                sf::Event event;
                while (win.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed) {
                                win.close();
                        }
                }

                win.clear(sf::Color::Black);
                win.display();
        }

        return 0;
}

9
General / Does setframelimit have a memory leak in 2.1?
« on: November 01, 2014, 10:57:56 am »
Using C++ and after commenting out the line my program stopped increasing in memory by 4kb every second?  With it uncommented it would consistently increase in memory every 4kb which is pretty nuts to me.  This happened using C# too, but I thought it was just my shitty coding that was the issue.  Thought I'd check memory usage with SFML before I got into my game and bam noticed that and I'm not sure if that's normal?

Nothing special in my code:

void Game::run()
{
        //initialize window
        window.create(VideoMode(width, height), name);

        //set framerate
        //window.setFramerateLimit(60);

        //load assets
        loadAssets();

        //game loop
        loop();
}

10
DotNet / Re: Question regarding image loading.
« on: July 08, 2014, 02:01:16 am »
It works wonders to read the documentation.

Quote
The supported image formats are bmp, png, tga, jpg, gif, psd, hdr and pic. Some format options are not supported, like progressive jpeg. If this function fails, the image is left unchanged.

I should have known that it was a progression jpeg, my mistake.

11
DotNet / Re: Question regarding image loading.
« on: July 07, 2014, 08:39:10 pm »
Of course it existed lol.  Like I said when I downloaded the file from the internet it crashed the program saying it couldn't load the file.  I opened the image and resaved it using mspaint and it worked perfectly fine.  The question is why does the original internet file crash the app?

More clarification: I downloaded the file from the internet to my computer as bg.jpg, crashed.  Opened the same file in mspaint, resaved it, worked fine.

12
DotNet / Question regarding image loading.
« on: July 07, 2014, 06:26:43 pm »
Yesterday I was messing around and tried downloading an image from the internet: http://wfiles.brothersoft.com/c/cat-photograph_195926-1280x720.jpg this image to be exact.  The program crashed repeatedly saying it couldn't load the image, so I thought it was to do w/ my bindings (went sort of nuts w/ recompiling etc... lol) and then I opened the image in paint and resaved it to something else and it loaded properly?

Why exactly was the script crashing?  It was a basic:
Image bg = new Image("bg.jpg");

W/ bare minimum window creation:

RenderWindow window = new RenderWindow(new VideoMode(windowSize.X, windowSize.Y), "Window", Styles.Titlebar | Styles.Close);

window.Closed += (object s, EventArgs e) => {
        RenderWindow w = (RenderWindow) s;
        w.Close();
};

Image bg = new Image("bg.jpg");

while(window.IsOpen) {
        window.DispatchEvents();
        window.Clear(Color.Magenta);
        window.Draw(bg);
        window.Display();
}

Which was weird to me.  Note was using the latest source bindings, compiled w/ VS2012 + the CSFML files from here http://nightlybuilds.ch/project/show/4/CSFML/

13
Yep, its just part of finally getting SFML.NET up to par with the core C++ SFML.

One thing that's quite weird is changing isOpen() to a variable, because the C++ version is a method as well unless the C++ version is going to change?

14
Thanks that worked, I guess .IsOpen isn't a method anymore and I need to use SFML.System now for Vector2f, etc...

15
When I click on the area using a standard render window (black part) the window doesn't focus until I click the title bar or the edge of the window.

I read they fixed this a long time ago, so either the dotnet bindings aren't updated or it was never fixed :/?

Pages: [1] 2 3 4