1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How to keep track of Memory usage
[Re: Dooley]
#466704
06/28/17 09:41
06/28/17 09:41
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
Serious User
|
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
max_nexus : this is dependant on how much ram your target computer has correct? This will be a 32bit limit, correct? , I just check task manager for ram usage. Your game should be below 1400/1500 mb iirc (depends a bit per pc).
|
|
|
Re: How to keep track of Memory usage
[Re: Reconnoiter]
#466712
06/28/17 12:35
06/28/17 12:35
|
Joined: Apr 2002
Posts: 1,246 ny
jumpman
OP
Serious User
|
OP
Serious User
Joined: Apr 2002
Posts: 1,246
ny
|
New entities will always need memory, and if I know the budget, then I can work under it. If you can work under a budget, as well as purging memory, my understanding is that you shouldn't run into memory problems.
But of course it's not that easy. I can create a model using ent_create, see the d3d_texfree decrease. When I ent_purge and ent remove, that entity, I regain that d3d_texfree. This is good. But if I create a terrain, and ent_remove, and ent_purge, the d3d_texfree slowly increases....eventually giving me nexus too small (0) errors! So if I made a game and the player continually loads a new level, this could cause memory not to be cleaned...and eventually crash.
What should I do?
|
|
|
Re: How to keep track of Memory usage
[Re: Dooley]
#466723
06/29/17 07:43
06/29/17 07:43
|
Joined: May 2005
Posts: 868 Chicago, IL
Dooley
User
|
User
Joined: May 2005
Posts: 868
Chicago, IL
|
I have discovered something.
If you change an entities skin, use ent_setskin(); instead of ent_morphskin();
With ent_morphskin, it uses a string to load the bitmap. With ent_setskin, it uses a previously declared BMAP* pointer.
The difference is that you can only use bmap_purge on BMAP* pointers, not on strings. This has been my experience anyway.
Currently, I was able to load several entities, purge their entities and bitmaps and load more, and the "d3d_texskins" number stays fixed, it no longer creeps up as I add more entities...
I am still seeing overall RAM usage creeping up though, but not nearly as much as before. I believe there are some objects/entities that I have not yet purged properly, so I need to keep looking through my code...
Anyway, I hope some of this provides the info you're looking for. Let me know if you find out any more about this.
|
|
|
|