SFML community forums

Help => General => Topic started by: mihaineken on July 28, 2013, 08:23:18 pm

Title: resources
Post by: mihaineken on July 28, 2013, 08:23:18 pm
why the programas whrited in SFML consume lots of resources?
for example even a symple window consumes 40% RAM (I have 4GB).
Title: Re: resources
Post by: Lo-X on July 28, 2013, 08:29:47 pm
What do you do in your code ?

I just launched a window and code that contains about 50 shapes and it took 0.2-0.3% of 6Gio RAM. (Linux @Ubunu)
Title: Re: resources
Post by: The Terminator on July 28, 2013, 09:22:44 pm
Well, sf::Texture is a pretty heavy class, but I doubt it would consume that much RAM unless you were attempting to create and draw thousands of them.
Title: Re: resources
Post by: Ancurio on July 29, 2013, 12:27:27 pm
Well, sf::Texture is a pretty heavy class, but I doubt it would consume that much RAM unless you were attempting to create and draw thousands of them.

Actually, sf::Texture is not heavy not the RAM at all, since textures are stored in VRAM.
Title: Re: resources
Post by: mihaineken on July 29, 2013, 07:04:01 pm
I'm so sorry
I was totaly wrong.
I was thinking at somethig else when I was whriting the post.
It's not ram that is consuming, is CPU even with the smallest code that open a window.
Title: Re: resources
Post by: mihaineken on July 29, 2013, 07:11:52 pm
I'm using windows and whrite the code in code::blocks using sfml 2.
Title: Re: resources
Post by: Nexus on July 29, 2013, 07:13:28 pm
If you don't do anything, a CPU core will execute the loop at its full capacity.

To reduce CPU load, you have three possibilities, of which I recommend the third:
By the way, you can edit your post if you have something to add.
Title: Re: resources
Post by: mihaineken on July 29, 2013, 08:37:29 pm
yes... I look so silly, like... almost all the time...
thank you very much, you are such a nice people...