[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory size and allocation




Ingo Ruhnke:
> IIRC you can't really handle the situation where malloc() fails in
> systems which use memory over-commitment (such as linux), since the
> process just gets killed or worse. So you should instead try to never
> ever reach this point. Just free any memory that you no longer need
> and you should be fine.

So, if i remove all data i've not used in the last, let's say, 30 seconds, it 
should work?
This sounds strange to me... i'd prefer to fill the ram till there is space 
available and remove unused data when i run out of space, this should improve 
the game performance avoiding all the load/unload work...
Is this policy SO bad?


//===================
Steve Baker:
[cut]
> I think that if you truly expect your program to *NEED* to do this (very
> few do), then you should write your own memory allocator.

How can i know if i *NEED* to do this?
I've evaluated that the program may reach a peak of 80 Mb of RAM usage.
Maybe i should finish it to get a better idea of the requirements?


//==================

> I really, really would advise that you get your hands on a copy of Game
> Programming Gems (ISBN 1-58450-049-2) That contains papers on:
[cut]

Seems interesting, i'll take a look.



Thank you everyone!
Francesco