SFML community forums

Help => Graphics => Topic started by: Grain on March 03, 2013, 01:42:45 am

Title: [SFML 2.0] RenderTexture memory usage
Post by: Grain on March 03, 2013, 01:42:45 am
When I create a RenderTexture and call create(40, 40), it uses about 4 mb of memory. Is this normal?
Title: Re: [SFML 2.0] RenderTexture memory usage
Post by: eXpl0it3r on March 03, 2013, 01:48:17 am
How do you measure the memory usage and specially the change?
Besides the RenderTexture is allocated on the GPU, so are you checking the GPU memory? :D
Title: Re: [SFML 2.0] RenderTexture memory usage
Post by: Grain on March 03, 2013, 01:52:57 am
How do you measure the memory usage and specially the change?
Besides the RenderTexture is allocated on the GPU, so are you checking the GPU memory? :D

I'm creating a new RenderTexture every second and calling create(), and checking the memory in windows task manager. How would I go about checking the GPU memory?
Title: Re: [SFML 2.0] RenderTexture memory usage
Post by: eXpl0it3r on March 03, 2013, 02:06:32 am
and checking the memory in windows task manager.
That's not how one accurately messures memory changes and mostly never tells anything about the actual memory usage. The OS can assign as much memory as it wants and release whenever it wants.

How would I go about checking the GPU memory?
Probably with some GPU tools, I don't know.

Do you already have something running or even run into performance issues, or are you just paranoid about memory usage? ;D

As for the plain calucaltion of an image size: width*height*4*8 bits
4 because we have 4 Uint8 values for each channel in RGBA.
Title: Re: [SFML 2.0] RenderTexture memory usage
Post by: Grain on March 03, 2013, 02:19:39 am
Do you already have something running or even run into performance issues, or are you just paranoid about memory usage? ;D

After creating a few hundred RenderTextures, the program hangs (when I run out of memory).
Title: AW: [SFML 2.0] RenderTexture memory usage
Post by: eXpl0it3r on March 03, 2013, 07:40:16 am
Don't use hundred of RenderTexture. In theory you could do all operations on one single rebder texture.
RT are heavy and limited resources and one as to be careful with them.

What are you trying to achieve?
Title: Re: [SFML 2.0] RenderTexture memory usage
Post by: Laurent on March 03, 2013, 08:43:47 am
RenderTexture internally creates an OpenGL context, which uses a significant amount of RAM.
Title: Re: AW: [SFML 2.0] RenderTexture memory usage
Post by: Grain on March 03, 2013, 05:55:50 pm
RT are heavy and limited resources and one as to be careful with them.

This is what I wanted to know. Thanks!

RenderTexture internally creates an OpenGL context, which uses a significant amount of RAM.

Thanks!