Groogy/rbSFML — Issue #28: Classes Memory Footprint
Author: Groogy
Created: 2012-02-25 23:50:07+00:00
State: open

Alright since decided to implement that we can track the memory usage of instances in rbSFML for debugging purposes and maybe later even more.

There are some questions that will arise here. How much should the classes `#memory_usage` method return? There are some clear ones like `SFML::Event` that should only return a simple `sizeof( sf::Event )` and then we have border cases like sf::SoundBuffer where we should also return the actual HEAP allocated size. The hardest ones are the one that have most of their memory on the GPU and not on the normal memory that `#memory_usage` is supposed to return.

I'll write a list here with the special case classes and why I consider them special cases here:

- **Heap Allocated Memory**
- sf::SoundBuffer
- sf::Image
- sf::Event
- sf::Text
- sf::Shape
- sf::VertexArray
- **GPU Allocated Memory**
- sf::Texture
- sf::Window
- sf::RenderWindow
- sf::RenderTexture(This one also can have a depth buffer to consider)
- sf::Context

This issue is more or less to discuss... How much information should we output in the `#memory_usage` method?