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

Author Topic: Memory usage in SFML 2.3  (Read 4264 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Memory usage in SFML 2.3
« on: July 16, 2015, 04:08:14 pm »
Hi Everyone

I've recently upgraded our dev environment from SFML 2.0 to 2.3, and I've noticed something. The split of system to video memory seems to have changed, though the overall usage isnt wildly different. For example, this is a game on 2.0 and 2.3 (100% same game code, only difference is SFML version):

SFML 2.0
20mb system memory
52mb video memory

SFML 2.3
35mb system memory
44mb video memory

Does anyone know why this would be, I know quite a bit has changed under the covers......

Many Thanks
SFML 2.1

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Memory usage in SFML 2.3
« Reply #1 on: July 16, 2015, 04:16:14 pm »
How many memory data sets did you take and how did you obtain them?
Because if it's just one random data set for each case the difference means nothing at all.

I've no idea where more/less memory was used, but I'm curious what you gain from knowing that it has changed a few megabytes and more so what you gain from know why it changed. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: Memory usage in SFML 2.3
« Reply #2 on: July 16, 2015, 04:20:32 pm »
This was from around 6 samples of each. Not scientific, but not a million miles away.

We have to make games work on devices with as little as 32mb video memory and 1024x600 resolution (literally 15 year old hardware) and crappy Intel video drivers. So every megabyte counts.

We have to use every trick in the book to make the games work...

:)
SFML 2.1

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Memory usage in SFML 2.3
« Reply #3 on: July 16, 2015, 05:04:27 pm »
Even if 1 data structure was changed to be 1 byte larger, we still have no idea how many instances of it you have in your code. I can tell you now that we didn't introduce any weird 10 MB caches or something, so the difference you see is either from one of the dependencies (which did change a bit) or many many instances of some smaller object that did change a bit in size. Either way, only you can know where you are using memory. It isn't exactly rocket science to understand that any data structure you instantiate costs RAM, and the more of them you have the larger of an impact any size changes will make. ;)
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: Memory usage in SFML 2.3
« Reply #4 on: July 17, 2015, 01:13:38 pm »
Very true, but the game code is 100% identical between versions, so only SFML changes. It's not a problem, but aside from reading thousands of lines of code, or thousands of Git comments, it's hard to know what has changed between versions. Some kind of synopsis of changes would be handy but I know its extra work for someone :)

It does seem to run faster though, so that's good, and glad to see the Intel bug finally fixed. You don't know how happy that makes us :)
SFML 2.1

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Memory usage in SFML 2.3
« Reply #5 on: July 17, 2015, 02:36:55 pm »
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

 

anything