-
December 19th, 2011, 00:46 #1
High CPU use and memory hog using grouped skills
Has anyone noticed this before? I've done a search and couldn't bring anything up...
I have a character with quite a few skills (don't we all?) and I've used the group functionality in the skills tab of the character sheet. When I select "Group" the CPU usage of Fantasy Grounds goes up and memory use starts to rise. If I leave the character sheet open on the skills tab my Fantasy Grounds takes up more and more memory and eventually crashes out just short of 2GB memory use (Fantasy Grounds just stops running - no warnings, it just disappears). Also, while taking more CPU this way there is a distinct lag in displaying dice rolls etc from the player in question.
If I switch to another tab in the character sheet or disable grouping, memory use drops down to the original level as does CPU use.
Any ideas on what could be causing this? I'm presuming something constantly looping to do the grouping?
-
December 19th, 2011, 09:00 #2
is this similar to what happens when you open 8 or 10 windows inside FG?
-
December 19th, 2011, 09:05 #3Originally Posted by damned
-
December 21st, 2011, 03:35 #4
- Join Date
- Aug 2011
- Location
- Montreal, Canada
- Posts
- 1,172
I confirm a sharp increase in CPU when a character is opened on the Skills page and it is set to "Grouped". When I ungroup the skills, the CPU goes back down.
I am not seeing any memory leak when monitoring resources though. The memory usage increased when grouping, but it remained stable at the increased amount.
For the test, I have put about 45 skills in 5 different groups. I was not doing anything else within FG during the test. On the attached images, FG is using the third CPU.
Originally Posted by TrenloeLast edited by lachancery; May 23rd, 2012 at 15:44.
-
December 21st, 2011, 05:14 #5Originally Posted by lachancery
I'm not sure if it's the amount for groups my main character has (15) or something else on top that makes the steady increase in memory. I'm going to do some more testing from the ground up (a new character) and see if there is a threshold or something that I can lay my hands on...
-
January 10th, 2012, 09:48 #6
We also noticed that when players have their skills grouped and they made a roll with their skill tab open (usual behaviour if you're rolling a skill SM/MM!) there was a lag of a few seconds before their roll would be displayed. This didn't occur when grouping was off.
I've found the culprit - basically, when skills are grouped there is a constant rebuild loop entered into (code in charsheet_skilllist.lua). Rebuild rebuilds the list, which changes the list, which leads to the onListRearranged function being called, which calls a rebuild and so it goes on... Taking valuable FG scripting resources and so leading to slow response of rolls etc (and in my case a memory leak and eventually a crash).
Change the following code in charsheet_skilllist.lua:
Code:function onListRearranged(changed) rebuild(); end
Code:function onListRearranged(changed) -- Only rebuild if the skills aren't grouped - avoids constant rebuild loop. if not isGrouped() then rebuild(); end end
-
January 10th, 2012, 12:19 #7
Well done, I will make that change in my FRP extention as well.
-
January 10th, 2012, 18:45 #8
- Join Date
- Aug 2011
- Location
- Montreal, Canada
- Posts
- 1,172
Good catch! Have you run tests that some valid calls to onListRearranged while the skills are grouped don't need a rebuild?
-
January 10th, 2012, 20:23 #9Originally Posted by lachancery
One thing that I have noticed with putting in this fix is that there are now group headings appearing - they never appeared before! Looks like the onListRearranged rebuild loop resulted in the rebuild code never completing and so headings weren't shown.
Perhaps adding a radial menu item to manually rebuild grouped skills might be an option? Or, I just try and sort out what the base issue is...
-
January 10th, 2012, 20:47 #10
- Join Date
- Aug 2011
- Location
- Montreal, Canada
- Posts
- 1,172
Sounds like a toggle variable "NeedRebuild" would be the best fix...
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks