Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,365 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
memory problem #366744
04/06/11 21:19
04/06/11 21:19
Joined: Jan 2010
Posts: 23
D
Darkmax Offline OP
Newbie
Darkmax  Offline OP
Newbie
D

Joined: Jan 2010
Posts: 23
hi i'm developing an application where i need to load several models, but i show it and when the user press space bar i delete that one and load another one, my problem is that the memory of the process reach to 2gb.

i tried with ent_purge(), ent_remove(), and on the stats of gamestudio said that i'm releasing the memory but on my task manager the process acknex.exe *32 the memory is growing with each new model i load.

if some know why this is happening because, this is a big problem for me and i have to resolve this quickly for my project.

My game studio version is 7 and my computer has windows 7 ultimate 64x

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 Offline
Expert
Uhrwerk  Offline
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
D
Darkmax Offline OP
Newbie
Darkmax  Offline OP
Newbie
D

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 Offline
Expert
Uhrwerk  Offline
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
D
Darkmax Offline OP
Newbie
Darkmax  Offline OP
Newbie
D

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 Offline
Expert
Uhrwerk  Offline
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.
Originally Posted By: The almighty manual
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:
Code:
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
D
Darkmax Offline OP
Newbie
Darkmax  Offline OP
Newbie
D

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] #366763
04/06/11 22:59
04/06/11 22:59
Joined: Jan 2010
Posts: 23
D
Darkmax Offline OP
Newbie
Darkmax  Offline OP
Newbie
D

Joined: Jan 2010
Posts: 23
i don't if there something like level_load but more controlled that doesn't remove all from the memory just what the models that i load is removed something like ent_purge but for the RAM

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 Offline
Expert
Uhrwerk  Offline
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...
Re: memory problem [Re: Uhrwerk] #366765
04/06/11 23:11
04/06/11 23:11
Joined: Jan 2010
Posts: 23
D
Darkmax Offline OP
Newbie
Darkmax  Offline OP
Newbie
D

Joined: Jan 2010
Posts: 23
awakelib is a library that a user from this forum implemented to manage queue, stacks, linked list.

and the AR library is for a detection of a mark with a webcamera that return the position and rotation and you can load a 3d model on the mark, there are a lot of examples in youtube of augmented reality apps.

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1