What you see in taskmanager if the amount of memory the application 'owns'.
It is not necessarily ALL in use as far as the application is concerned.
It can hold memory back from from the OS in RESERVE for it to use.

Level_free releases a set 'chunk' back to the OS when you tell it to.

Level_mark SETS a point in memory. When you then do a level_free, then
everything created AFTER that mark will be released.

Level_load releases it ALL, and starts afresh.

These three level_? commands are manually controlling the nexus, which is
the primary 'level' space used by the engine.

If you dig far enough back in the 'Ask the developers' forum you will find
a large discussion/argument between me and JCL on this issue, because
I wanted the nexes to be 'manipulatable' in the way you seem to.
THIS WILL NEVER HAPPEN!

In a nutshell, handling memory 'that way' is in-efficient and CAN add serious
cpu-overhead given commonly-occuring cercumstances. So JCL just isnt going to
go there. End of discussion.

BUT, the memory handling as it is now is more powerful, and more flexible than
is stated anywhere by anyone. And IF your situation allows you to actually
use level_mark etc, then it makes life very easy.


But ... if you cant or wont use the level_mark/level_free functions (like me)
then you are largely on your own, flying in the dark.

If you want to do MICRO-MANAGING things like checking if memory from a removed
entity HAS actually been freed, you need to write your own test routines.
There doesnt seem to be any way of telling the truth from looking at any of the
'system' variables that SHOULD report this information.

Maybe there IS a way, but Ive never found it, or anyone who knows it.


Do me a favour... Run the following script with your entity in place of
the "BLOB.MDL" in the 'ent_create' command. And tell me what happens...
And leave it running for 10 minutes if it can...

Click to reveal..
Code:
#include <acknex.h>
#include <default.c>
//
var i, counter=0;
//
action lifetime()	
{	vec_set(me.x, vector(random(100)-50,random(100)-50,random(100)-50));
	ent_clone(me);		counter++;		wait(100);		ptr_remove(me);		}
//
void main()
{
	wait(1);		level_load(NULL);		wait(1);			camera.x=-350;		def_debug();
	//
	while(1)
	{
		for(i=0; i<10; i++)		{	ent_create("blob.mdl",	nullvector, lifetime); 	}
		//
		DEBUG_VAR(counter, 100);
		//
		wait(1);
	}
}





"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial