STAR TREK 2d20
Page 1 of 2 12 Last
  1. #1
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413

    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?

  2. #2

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by damned
    is this similar to what happens when you open 8 or 10 windows inside FG?
    Don't think so mate - as simply disabling grouping from the radial menu stops it happening.

  4. #4
    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.

    Quote Originally Posted by Trenloe
    Has anyone noticed this before?

    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?
    Last edited by lachancery; May 23rd, 2012 at 15:44.

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by lachancery
    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.
    Thanks for double checking on this.

    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...

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    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
    To:

    Code:
    function onListRearranged(changed)
      -- Only rebuild if the skills aren't grouped - avoids constant rebuild loop.
      if  not isGrouped() then
        rebuild();
      end
    end
    Fixed!

  7. #7
    Ardem's Avatar
    Join Date
    Nov 2011
    Location
    Sydney, Australia
    Posts
    920
    Well done, I will make that change in my FRP extention as well.

  8. #8
    Good catch! Have you run tests that some valid calls to onListRearranged while the skills are grouped don't need a rebuild?

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by lachancery
    Good catch! Have you run tests that some valid calls to onListRearranged while the skills are grouped don't need a rebuild?
    In the tests I've done, the only thing that I've found is that if you change the "group" of an individual skill then this is not reflected in the grouping immediately - ungrouping then regrouping fixes this issue.

    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...

  10. #10
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in