[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Memory consumation on graphics



Hello all

I wonder how the memory consumation on graphics can be calculated. Im using a lot of images in my project and would like to know how much memory it is using. Unfortunately I only see the initial memory that my Mac is spending to my game and after loading a certain amount of additional images the OS extends the swap memory space by a default size.
A friend of mine told me once that an expanded image in the memory can be x time bigger than the physical size on the harddisc.
Im using PNG and JPG. Is there a default factor for all image types you can multiply with the physical image size on the harddisc?


Greetings
Farai


Am 14.10.2006 um 02:33 schrieb Greg Ewing:

Kris Schnee wrote:
Right now the function itself says "import pygame," but I'd like to account for the possibility that pygame will already be loaded when the file it's a part of is incorporated into a bigger project.

If you're trying to avoid loading the module twice, there's no need. A given module is only loaded into memory once per program. Subsequent import statements for the same module just return another reference to the previously loaded module object.

So just go ahead and import it wherever you need
it.

--
Greg