SFML community forums
Help => General => Topic started by: K-Bal on April 09, 2009, 02:35:19 pm
-
Hey there,
I recognized that my SFML applications under Ubuntu use at least 40 megs of RAM. Even if I just open a RenderWindow and do nothing else but running the game loop.
I don't know if that is normal, but I guess that could be optimized.
I'm using 1.5 from the SVN.
Cheers,
Marius
-
SFML doesn't sleep unless you tell it to (or UseVerticalSync() or SetFramrateLimit() ) using sf::Sleep()
-
He's not speaking about CPU but RAM. :wink:
That's odd, one of my application only need 5 MB of writable memory.
But its virtual memory is 34.3 MB.
Which kind of memory do you speak ?
-
Is it a fixed amount, or is it growing? Is it happening with other modules (network, audio)?
-
The amount of memory usage ist relatively constant at about 40 megs with a minimal application:
Creating a RenderWindow and running the game loop.
I didn't test this on Windows, I'm using Ubuntu 8.10.
-
What about other modules?
-
What about other modules?
I'll might check that out, if I have the time. At the moment I'm using my spare time for the SFML community contest of the german forum ;)
Next week, I'm back home, where I also have a Windows XP machine to test on.
-
The first thing I had time to check for was the difference between debug and release version.
The result: they both use about the same amount of RAM.
-
Sounds weird that it takes that much memory? It could be that SFML uses Xlib pixelbuffs(I think they were called that) too much?
-
SFML doesn't use pixelbuffs (I don't even know what it is).
-
I don't remember the correct name for the structure but it's Pixel... something. Anyway It's like Xlib's "Images" and is used to transfer image data from the client(application) to the server(display). Instead of sending the image all the time, it just passed the id of the image and the server knows what image it's talking about. Something like that.
You know the X-protocol was supposed to work over networks too :P
** EDIT **
It might be "Pixmaps". I searched quickly on the web and stumbled upon that name
-
Xlib is used only for windowing, SFML doesn't use it at all for graphics. Only OpenGL is used.
-
Hmm ah then I'm lost. I haven't looked at glx at all so I don't know how it works.
Maybe is so that X server needs that much memory for an OpenGL Rendering context?
-
I'm running Ubuntu 8.10 also and all of the sample programs I've tried average about 9.5 MiB.
EDIT: I'm using 1.5 from the SVN as well.
-
K-Bal, do you use option '-s' or '-Os' at compiling time ?
(I do.)
-
K-Bal, do you use option '-s' or '-Os' at compiling time ?
(I do.)
I don't know, I'll take a look this evening ;)
-
I used -s but no -Os, however, those compiler settings don't make a difference.
-
Of course they don't. It only changes the executable file size, not the memory usage.
-
If you don't use -s your OS might load all debug symbols. Or I'm wrong ?
Anyway it seems not being the point here.
-
How are you getting the memory usage of the application? Linux and even Mac OS X for that matter don't always tell you the truth when it come to how much a program is actually using in memory. I've found that most of the time Linux will allocate a lot more memory than is needed for a program so the program can access more memory faster when needed.
-
You also have to take memory caches into account.
-
Yeah, might be. I just used the ubuntu system check tool.