2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: memory problem
[Re: Darkmax]
#366748
04/06/11 21:36
04/06/11 21:36
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
ent_remove just removes the entity. ent_purge removes the entities texture from video memory not from RAM.
Try if a "level_load(NULL);" works out for you. Whats the size of the models you use?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: memory problem
[Re: Uhrwerk]
#366752
04/06/11 21:50
04/06/11 21:50
|
Joined: Jan 2010
Posts: 23
Darkmax
OP
Newbie
|
OP
Newbie
Joined: Jan 2010
Posts: 23
|
i tried level_load(NULL); but is the same, my models are from 859kb to 74,211kb i tried to reduce it all i can, with smaller textures and change the texture from tga to DDS textures.
Also i notice that on the statics: *m virtual memory allocation (sys_memory)
is growing with each model i load
Last edited by Darkmax; 04/06/11 21:52.
|
|
|
Re: memory problem
[Re: Darkmax]
#366753
04/06/11 21:57
04/06/11 21:57
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Ok, so your models basically vary between 1 and 70 MB. There is still a long road to hit the 2 GB mark. Can you please post the code you're using?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: memory problem
[Re: Uhrwerk]
#366758
04/06/11 22:18
04/06/11 22:18
|
Joined: Jan 2010
Posts: 23
Darkmax
OP
Newbie
|
OP
Newbie
Joined: Jan 2010
Posts: 23
|
well i can't because i signed a form that prohibit me of do it, but basically this my code in general terms.
First i use ackmysql plugin to connect to a database where i have the name and address where is located the models that i'm going to load, this information i load it in an array.
Then in the loop on the main method i check if the user press the bar i load the first model of the array that i get from the database, then if the user press it again the i clean up the entity with ent_purge and the load the next model with ent_morph.
Also i use the awakelib because i need in some part of the code a stack that is implemented in this library, and another library to make this an AR application.
Sorry that i cant show you my code but, i hope you understand
Last edited by Darkmax; 04/06/11 22:19.
|
|
|
Re: memory problem
[Re: Darkmax]
#366760
04/06/11 22:43
04/06/11 22:43
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Ok, as you're not allowed to show your code I can only do wild guesses here. The level_load instruction should in any way solve your problem. When you perform a level_load all entities are removed and their files get removed from the level cache. The current level is closed, the cache holding level entity files is purged. All current entities in the old level are removed, thus all entity pointers referring to them can't be used anymore. My basic idea is as follows:
STRING* mymodels = getmodelnamearraywhatever();
int numberofmodels = countmodelnamearraywhatever();
int i;
for (i = 0; i < numberofmodels; i++)
{
level_load("");
wait(2);
ent_create(mymodels[i],nullvector,NULL);
while (!key_space) wait(1);
while (key_space) wait(1);
}
Does that help you solve the problem?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: memory problem
[Re: Uhrwerk]
#366762
04/06/11 22:57
04/06/11 22:57
|
Joined: Jan 2010
Posts: 23
Darkmax
OP
Newbie
|
OP
Newbie
Joined: Jan 2010
Posts: 23
|
mmm i tried what you mentioned about level_load but the problem is that it cause a error, for example i lost my background that is image from my camera that is used for the AR part, because that is a entity(plane with the frame of the camera).
And the part of Augmented Reality is important for the program, but that part of the AR what i see that it does is create a entity(plane) with the frames of the camera and load some libraries that can detect a mark and return the position,rotation of the mark in general, because i didn't create that library and is a little complex to contact right now ,the developer who implemented.
Last edited by Darkmax; 04/06/11 23:06.
|
|
|
Re: memory problem
[Re: Darkmax]
#366764
04/06/11 22:59
04/06/11 22:59
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
I neither know awakelib, nor what an AR Application is sorry. level_load will of cause remove all entities. When you use an entity for background you have to re-create this one as well. Alternatively set up a map in WED that fits your needs and load that map instead of an emtpy map.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|