there is a way to free memory and you can see it in taskmanager:
at first i have a model that has a 2048*2048 dds texture that make model size to about 4 mb.
so my code is :

///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
///////////////////////////////
ENTITY* e1;
function rm(ENTITY* e2)
{
BMAP* bmap_temp=ent_getskin(e1,1);
if (bmap_temp!=NULL) ptr_remove(bmap_temp);
bmap_temp=ent_getskin(e1,2);
if (bmap_temp!=NULL) ptr_remove(bmap_temp);
ent_purge(e1);
ent_remove(e1);
ptr_remove(e1);
safe_remove(e1);
e1=NULL;
level_free();
level_mark();
}

function main()
{
level_load("");
wait(2);
level_mark();
e1=ent_create("CAM1-PAINT.mdl",vector(1000000,0,0),NULL);wait(-0.5);rm(e1);
e1=ent_create("......
and 40 lines like above for 40 other entites like that
}

I found the main code is level_free() and level_mark(). without these two ,memory increase a lot.


why there is not a command to delete a entity and free it's memory?
how can i check that my code free memory when engine , don't show me that.

Last edited by flatron; 09/09/12 08:40.