You mis-understand my questions. I will try phrasing them differently.
QUESTION>1
Once I have sucessfully cloned an entity, used it for my nefarious purposes, and no-longer need it
(as in a destroyed artifact), i would expect using ent_remove, ptr_remove, or ent_purge would release
all of the resources the entity was consuming.
But it doesnt... All the nexus it was using is still in use.
I know this because in my project (which is too large and scattered to post), I do basically this...
Step 1> ent_create(same model every time)
Step 2> clone_ent
Step 3> modify its mesh
Step 4> leave it visible a while
Step 5> ent_purge & ent_remove
This process occurs with up to 50 entities at any one time, and the problem is my memory consumption
(ie nexus) and as shown in WindowsTaskManager/Processes just keeps growing by 500k per entity created.
BUT if I kill ONLY Step2 (ent_clone), all ents look the same now, but my memory consumption STOPS growing.
So in my mind that tells me the cloned entity is not being released from memory by ent_purge or ent_remove.
See what my problem is, and why I think its ent_clone?
PS If Im not using the correct way to purge the memory of the ent_clone, I apologise and please explain.
QUESTION>2
My second question was why does ent_clone consume space when used on the same entity more
than one time. Only the most recent clone will be valid (and accessable), so isnt any of the intermediate
clones of this entity a waste of resources? It would be a programming flaw to allow this to happen in
one's code, but shouldnt the engine try to protect against certain types of programmer mistakes?
Example
ENTITY* test = ent_create("MyModel.mdl",...); //creates "MyModel.mdl" at address #1
ent_clone(test); //creates a clone "MyModel.mdl" at address #2
ent_clone(test); //creates a another clone "MyModel.mdl" at address #3
ent_clone(test); //creates a another clone "MyModel.mdl" at address #4
ENTITY* test2 = ent_create("MyModel.mdl",...); //I assume this points to the "MyModel.mdl" at address #1 (please correct if wrong assumption)
Isnt the existance of the clones at addresses #2 and #3 a waste of space? And if I then say
ent_purge(test); and ent_remove(test); then which model at which address (if any) get free'ed?
Wouldnt it be "better" if the enging took away this chance of dumb programmer errors by working like this instead?
Example
ENTITY* test = ent_create("MyModel.mdl",...); //creates "MyModel.mdl" at address #1
ent_clone(test); //creates a clone "MyModel.mdl" at address #2
ent_clone(test); //does nothing as 'test' is already a clone, and is thereby unique
ent_clone(test); //still does nothing as 'test' is already a clone, and is thereby unique
ENTITY* test2 = ent_create("MyModel.mdl",...); //I assume this points to the "MyModel.mdl" at address #1 (please correct if wrong assumption)
Thanks for your time.
And again, I'll make this the first post of a new thread either here in Bugs, or in Ask-Developers
forum if you want.