문제

I have a very simple SDL program that uses only 1MB of memory with 32 bits per pixel, 2.4MB with 24 bits per pixel, 1.9MB with 16 bits per pixel, and 1.4MB with 8 bits per pixel. what is with this strange memory usage? why does the most bits per pixel take up the least amount of memory?

C++ GCC

thanks

도움이 되었습니까?

해결책

Perhaps internal conversion buffers. If your surface bpp doesn't match your hardware surface you may need to store the full buffer in memory, whereas SDL may be able to use that surface directly otherwise. This is just a guess offhand.

But looking at a process in top or task manager may not be the best way to get a handle on what's using memory. If you're on Linux you can try a tool such as valgrind to get a very good idea of where memory is going.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top