GameMonkey Script

GameMonkey Script Forums
It is currently Mon Oct 22, 2018 8:19 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Mar 12, 2010 2:16 pm 
Offline

Joined: Fri Jan 14, 2005 2:28 am
Posts: 439
In gmMachine::CollectGarbage, there is some code that can resize the hard and soft memory limits automatically to account for real memory usage. The symptom of this bug is that the memory limits don't resize properly, resulting in a full collect being done every frame as it attempts to compensate. I noticed this in my app after a 10 minute period resulted in over 12000 full collects.

Simple fix
Code:
int newHard = (int)(GMMACHINE_GC_HARD_MEM_INC_FRAC_OF_USED * (float)afterMemUsage);
int newSoft = (int)(GMMACHINE_GC_SOFT_MEM_DEFAULT_FRAC_OF_HARD * (float)GetDesiredByteMemoryUsageHard());


should be
Code:
int newHard = (int)(GMMACHINE_GC_HARD_MEM_INC_FRAC_OF_USED * (float)afterMemUsage);
int newSoft = (int)(GMMACHINE_GC_SOFT_MEM_DEFAULT_FRAC_OF_HARD * (float)newHard);


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 13, 2010 8:57 am 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 707
Thanks DrEvil, I'll have a look into this. It does appear I'm using the old value instead of the new value to recalibrate.


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 14, 2010 11:38 pm 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 707
I've looked at the code and tested the fix, looks good DrEvil. I've updated my build to 1.26.2 with this change.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group