free memory

Posted By: flatron

free memory - 09/09/12 12:08

Hi
i made a studio that player can select a car between 40 diffrent car.
each car size and it's parts have 16mb and palyer can select bodypaint for his car between 210 body paint(2048*2048 dds texture)

now i have problem.if player want to see some cars and some bodypaints,memory will be full.

i need some advices to free memory.

i find that it is enough to use ptr_remove for BMAP* to free memory but what about entities that have 2 skin with shaders?

i asked here:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=407208&page=1
Posted By: Superku

Re: free memory - 09/09/12 16:10

You don't want to use ptr_remove, but bmap_purge or rather ent_purge.
Btw. I doubt that you create (40*)210 different textures on your own, just use one or a few shaders with different material properties (f.i. realized via vecSkill41 and all the other shader variables).
Posted By: flatron

Re: free memory - 09/15/12 18:40

I do this exactly.
but I think there is some problem in removing entities.

I think make one entity and change it's texture by shader is better than load a another entity because ent_remove dosn't remove entity completely and some data remain in memory.
I wrote a program and check it.
Posted By: Uhrwerk

Re: free memory - 09/16/12 19:31

Originally Posted By: flatron
because ent_remove dosn't remove entity completely and some data remain in memory. I wrote a program and check it.

Then prove it and post this program in the bug secetion. If ptr_remove wouldn't free all the memory this would clearly be a bug that needed fixing.

As you posted about this topic numerous times I still think you have got a bug, i.e. a memory leak on your side and as long as this is the case reducing the memory footprint of your programm won't help you.
Posted By: GameScore

Re: free memory - 09/17/12 07:33

i use ent_purge to clear thr memory

Code:
ent_purge(my);ent_remove(my);




ent_purge(ENTITY*);
Releases texture memory, meshes and decals used by the entity. Useful for freeing the video memory when entities of a certain type won't be visible anymore. Video memory is automatically allocated again when the entity is seen the next time - so this function won't do any harm. However, any functions affecting the entity mesh or texture - such as bmap_to_alpha - must be performed again. Thus ent_purge followed by bmap_to_alpha can also be used to change the alpha factor of an entity texture. In a multiplayer system this instruction only affects the current PC.
Posted By: jcl

Re: free memory - 09/17/12 07:50

ent_remove removes ONLY the entity. It does of course not remove the model, sprite, or terrain file itself, as it might be used also by other entities. This file stays in the level cache and can only be removed with level_change or nexus_free commands.
© 2024 lite-C Forums